To show database tables first connect to the local PostgreSQL and connect to the database (\c db_name), then you can view database tables list. Continue Reading
Tag: PostgreSQL
PostgreSQL: use database
Connect to the PostgeSQL via psql
[root@s ~]# su postgres bash-4.4$ psql psql (10.6) Type "help" for help. postgres=#
Connect to the database – \c
postgres=# \c quaded You are now connected to database "quaded" as user "postgres". quaded=#
PostgreSQL: show databases list
Connect to the PostgreSQL via psql
[root@s ~]# su postgres bash-4.4$ psql psql (10.6) Type "help" for help. postgres=#
List the databases – \l
postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- quaded | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres (4 rows) postgres=#