current_catalog 是一个返回当前数据库名称的系统函数。
current_catalog 在 PostgreSQL 8.4 中添加。
用法
current_catalog → name
current_catalog 是对 current_database() 的 SQL 标准等效函数。
变更历史
- PostgreSQL 8.4
- 添加(提交 0fec77ae)
示例
current_catalog 的用法示例
postgres=# SELECT current_catalog; current_catalog ----------------- postgres (1 row) postgres=# \c template1 You are now connected to database "template1" as user "postgres". template1=# SELECT current_catalog; current_catalog ----------------- template1 (1 row)
参考资料
- PostgreSQL文档: 系统信息函数和运算符
