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