OS Manuals

/usr/bin/pg_dumpall

PostgreSQL client

From postgresql-12-client 12.18-r4 (os), captured 2026-11-05 by running pg_dumpall --help (exit 0). permalink

Also provided by 11 other package versions
pg_dumpall extracts a PostgreSQL database cluster into an SQL script file.

Usage:
  pg_dumpall [OPTION]...

General options:
  -f, --file=FILENAME          output file name
  -v, --verbose                verbose mode
  -V, --version                output version information, then exit
  --lock-wait-timeout=TIMEOUT  fail after waiting TIMEOUT for a table lock
  -?, --help                   show this help, then exit

Options controlling the output content:
  -a, --data-only              dump only the data, not the schema
  -c, --clean                  clean (drop) databases before recreating
  -E, --encoding=ENCODING      dump the data in encoding ENCODING
  -g, --globals-only           dump only global objects, no databases
  -O, --no-owner               skip restoration of object ownership
  -r, --roles-only             dump only roles, no databases or tablespaces
  -s, --schema-only            dump only the schema, no data
  -S, --superuser=NAME         superuser user name to use in the dump
  -t, --tablespaces-only       dump only tablespaces, no databases or roles
  -x, --no-privileges          do not dump privileges (grant/revoke)
  --binary-upgrade             for use by upgrade utilities only
  --column-inserts             dump data as INSERT commands with column names
  --disable-dollar-quoting     disable dollar quoting, use SQL standard quoting
  --disable-triggers           disable triggers during data-only restore
  --exclude-database=PATTERN   exclude databases whose name matches PATTERN
  --extra-float-digits=NUM     override default setting for extra_float_digits
  --if-exists                  use IF EXISTS when dropping objects
  --inserts                    dump data as INSERT commands, rather than COPY
  --load-via-partition-root    load partitions via the root table
  --no-comments                do not dump comments
  --no-publications            do not dump publications
  --no-role-passwords          do not dump passwords for roles
  --no-security-labels         do not dump security label assignments
  --no-subscriptions           do not dump subscriptions
  --no-sync                    do not wait for changes to be written safely to disk
  --no-tablespaces             do not dump tablespace assignments
  --no-unlogged-table-data     do not dump unlogged table data
  --on-conflict-do-nothing     add ON CONFLICT DO NOTHING to INSERT commands
  --quote-all-identifiers      quote all identifiers, even if not key words
  --rows-per-insert=NROWS      number of rows per INSERT; implies --inserts
  --use-set-session-authorization
                               use SET SESSION AUTHORIZATION commands instead of
                               ALTER OWNER commands to set ownership

Connection options:
  -d, --dbname=CONNSTR     connect using connection string
  -h, --host=HOSTNAME      database server host or socket directory
  -l, --database=DBNAME    alternative default database
  -p, --port=PORT          database server port number
  -U, --username=NAME      connect as specified database user
  -w, --no-password        never prompt for password
  -W, --password           force password prompt (should happen automatically)
  --role=ROLENAME          do SET ROLE before dump

If -f/--file is not used, then the SQL script will be written to the standard
output.

Report bugs to <pgsql-bugs@lists.postgresql.org>.
Options (44)
OptionDescriptionSource
-f, --file FILENAMEoutput file namehelp
-v, --verboseverbose modehelp
-V, --versionoutput version information, then exithelp
--lock-wait-timeout TIMEOUTfail after waiting TIMEOUT for a table lockhelp
-?, --helpshow this help, then exithelp
-a, --data-onlydump only the data, not the schemahelp
-c, --cleanclean (drop) databases before recreatinghelp
-E, --encoding ENCODINGdump the data in encoding ENCODINGhelp
-g, --globals-onlydump only global objects, no databaseshelp
-O, --no-ownerskip restoration of object ownershiphelp
-r, --roles-onlydump only roles, no databases or tablespaceshelp
-s, --schema-onlydump only the schema, no datahelp
-S, --superuser NAMEsuperuser user name to use in the dumphelp
-t, --tablespaces-onlydump only tablespaces, no databases or roleshelp
-x, --no-privilegesdo not dump privileges (grant/revoke)help
--binary-upgradefor use by upgrade utilities onlyhelp
--column-insertsdump data as INSERT commands with column nameshelp
--disable-dollar-quotingdisable dollar quoting, use SQL standard quotinghelp
--disable-triggersdisable triggers during data-only restorehelp
--exclude-database PATTERNexclude databases whose name matches PATTERNhelp
--extra-float-digits NUMoverride default setting for extra_float_digitshelp
--if-existsuse IF EXISTS when dropping objectshelp
--insertsdump data as INSERT commands, rather than COPYhelp
--load-via-partition-rootload partitions via the root tablehelp
--no-commentsdo not dump commentshelp
--no-publicationsdo not dump publicationshelp
--no-role-passwordsdo not dump passwords for roleshelp
--no-security-labelsdo not dump security label assignmentshelp
--no-subscriptionsdo not dump subscriptionshelp
--no-syncdo not wait for changes to be written safely to diskhelp
--no-tablespacesdo not dump tablespace assignmentshelp
--no-unlogged-table-datado not dump unlogged table datahelp
--on-conflict-do-nothingadd ON CONFLICT DO NOTHING to INSERT commandshelp
--quote-all-identifiersquote all identifiers, even if not key wordshelp
--rows-per-insert NROWSnumber of rows per INSERT;help
--use-set-session-authorizationuse SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownershiphelp
-d, --dbname CONNSTRconnect using connection stringhelp
-h, --host HOSTNAMEdatabase server host or socket directoryhelp
-l, --database DBNAMEalternative default databasehelp
-p, --port PORTdatabase server port numberhelp
-U, --username NAMEconnect as specified database userhelp
-w, --no-passwordnever prompt for passwordhelp
-W, --passwordforce password prompt (should happen automatically)help
--role ROLENAMEdo SET ROLE before dumphelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.