Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 308 Bytes

File metadata and controls

19 lines (10 loc) · 308 Bytes

Postgres

Dump and import

pg_dump dbname | gzip > db.gz

Before import, database must be empty.

gunzip -c db.gz | psql dbname

or

psql dbname -f db.sql

Get database size

First log in the console with psql dbname, then:

SELECT pg_size_pretty(pg_database_size('dbname'));