current_database()

返回当前数据库名称的函数

current_database() 是一个返回当前数据库名称的系统函数。

current_database() 添加于 PostgreSQL 7.3

用法

current_database () → name

current_catalog 提供作为 SQL 标准等效项。

更改历史

示例

current_database() 的执行

postgres=# SELECT current_database();
 current_database
------------------
 postgres
(1 row)

postgres=# \c template1
You are now connected to database "template1" as user "postgres".

template1=# SELECT current_database();
 current_database
------------------
 template1
(1 row)

分类

系统函数

另见

current_catalogcurrent_schema()current_user

反馈

提交任何关于 "current_database()" 的评论、建议或更正 在此