Contents
current_catalog
A function returning the name of the current database
current_catalog
is a system function returning the name of the current database.
current_catalog
was added in PostgreSQL 8.4.
Usage
current_catalog → name
current_catalog
is provided as an SQL-standard equivalent to current_database()
.
Change history
- PostgreSQL 8.4
- added (commit 0fec77ae)
Examples
Usage example for 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)
References
- PostgreSQL documentation: System Information Functions and Operators