May 2019
Intermediate to advanced
600 pages
20h 46m
English
The basic command to dump the definitions for every database of your PostgreSQL instance is as follows:
pg_dumpall --schema-only > myscriptdump.sql
This includes all objects, including roles, tablespaces, databases, schemas, tables, indexes, triggers, constraints, views, functions, ownerships, and privileges.
If you want to dump PostgreSQL role definitions, use the following command:
pg_dumpall --roles-only > myroles.sql
If you want to dump PostgreSQL tablespace definitions, use the following command:
pg_dumpall --tablespaces-only > mytablespaces.sql
If you want to dump both roles and tablespaces, use the following command:
pg_dumpall --globals-only > myglobals.sql
The output is a human-readable script file that can be re-executed ...
Read now
Unlock full access