Friday, August 23, 2019

Postgres psql command usage

+ Login to postgres server
psql -U [username: postgres] -d [dbname: postgtes] -h [IP server: 127.0.0.1] -p [5432]

+ List all databases
[postgres$] \l

+ Connect to database
[postgres$] \c [db name]

+ Show all table within table
[postgres$] \dt

+ Show all user
[postgres$] \du

+ Show connection info
[postgres$] \coninfo


No comments:

Post a Comment