Skip to content
This repository was archived by the owner on Nov 7, 2024. It is now read-only.

Latest commit

 

History

History
45 lines (30 loc) · 537 Bytes

File metadata and controls

45 lines (30 loc) · 537 Bytes

Useful Postgres Commands

Connecting to Postgres

$ psql postgres

List tables in database

postgres=# \d

List all databases

postgres=# \l

Connect to another database

postgres=# \c dbname

Exit postgres shell

postgres=# \q

Create database

postgres=# CREATE DATABASE databasename;

Drop database

postgres=# DROP DATABASE name;

Find more useful postgres commands here