Saturday, 18 May 2019

Postgres: List all databases


Login to any database and execute the command '\l' to list all the databases.
$psql -U postgres -h localhost --dbname=myOrg
Password for user postgres: 
psql (14.4)
Type "help" for help.

myOrg=# 
myOrg=# \l
                             List of databases
   Name    |  Owner   | Encoding | Collate | Ctype |   Access privileges   
-----------+----------+----------+---------+-------+-----------------------
 myOrg     | postgres | UTF8     | C       | C     | 
 postgres  | postgres | UTF8     | C       | C     | 
 template0 | postgres | UTF8     | C       | C     | =c/postgres          +
           |          |          |         |       | postgres=CTc/postgres
 template1 | postgres | UTF8     | C       | C     | =c/postgres          +
           |          |          |         |       | postgres=CTc/postgres
(4 rows)

myOrg=# 


Previous                                                 Next                                                 Home

No comments:

Post a Comment