SELECT current_database();
-- Query to get all database in PostgreSQL and their oid (alternative to l)
SELECT oid, datname FROM pg_database;
# List databases:
l
List all databases:
l
SELECT datname FROM pg_database;
# inside psql
l
SELECT datname FROM pg_database;
Code language: SQL (Structured Query Language) (sql)
l OR l+
l
Code language: Shell Session (shell)
postgres=# l+
Code language: psql