CURRENT_DATABASE

Returns a VARCHAR value containing the name of the database to which you are connected.

Behavior Type

Immutable

Syntax

CURRENT_DATABASE()

Notes

Examples

=> SELECT CURRENT_DATABASE();
 CURRENT_DATABASE 
------------------
 VMart
(1 row)

The following command returns the same results without the parentheses:

=> SELECT CURRENT_DATABASE;
 CURRENT_DATABASE 
------------------
 VMart
(1 row)