May 2018
Intermediate to advanced
576 pages
30h 25m
English
The basic command to dump the definitions only for every database of your PostgreSQL instance is the following:
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 this command:
pg_dumpall --roles-only > myroles.sql
If you want to dump PostgreSQL tablespace definitions, use the following:
pg_dumpall --tablespaces-only > mytablespaces.sql
If you want to dump both roles and tablespaces, use this command:
pg_dumpall --globals-only > myglobals.sql
The output is a human-readable script file that can be re-executed to recreate ...