Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 482 Bytes

Postgres.md

File metadata and controls

34 lines (23 loc) · 482 Bytes

psql commands

# List databases
\l

# list schemas
\dn

# list relations, including tables and views
\d

# list tables of default `public` schem
\dt 

# add schema to search
SET search_path TO <schema nam>, public;
SHOW search_path; 


# switch display mode
\x [on | off | auto]

sql queries

# check DB size
SELECT pg_size_pretty( pg_database_size('<db name>') );

SQL Join Venn diagram

Image of Yaktocat