PostgreSQL – Get current database name

Run the below command to check the current database you are connected to in Postgres.

SELECT current_database();

See also  PostgreSQL - How to limit the number of rows returned by a query