PG_DUMPALL(1) PostgreSQL 18.6 Documentation PG_DUMPALL(1) (NAME) pg_dumpall - PostgreSQL (SYNOPSIS) pg_dumpall [connection-option...] [option...] (DESCRIPTION) pg_dumpall ("dump ") PostgreSQL . SQL psql(1) . pg_dump(1) . pg_dumpall (global objects) (roles) (tablespaces) . ( pg_dump .) pg_dumpall (superuser) . superuser . SQL . -f/--file . pg_dumpall PostgreSQL ( ). . ~/.pgpass . 32.16 . (Warning) superuser . . superuser SQL . superuser . (OPTIONS) . -a --data-only ( ) . -c --clean SQL DROP . . --if-exists . -E encoding --encoding=encoding (character set encoding) . . ( PGCLIENTENCODING .) -f filename --file=filename . . -g --globals-only ( ) . -O --no-owner . pg_dumpall ALTER OWNER SET SESSION AUTHORIZATION . superuser ( ) . -O . -r --roles-only . -s --schema-only () . -S username --superuser=username superuser (triggers) . --disable-triggers . ( superuser .) -t --tablespaces-only . -v --verbose (verbose) . pg_dumpall / . (debug) . pg_dump . -V --version pg_dumpall . -x --no-privileges --no-acl ( grant/revoke) . --binary-upgrade (in-place upgrade) . . . --column-inserts --attribute-inserts INSERT (INSERT INTO table (column, ...) VALUES ...) . PostgreSQL . --disable-dollar-quoting (dollar quoting) SQL . --disable-triggers (schema) . pg_dumpall . . --disable-triggers (superuser) . superuser -S superuser . --exclude-database=pattern pattern . --exclude-database . pattern \d psql ( Patterns ) (wildcard) . (shell) . --extra-float-digits=ndigits (floating-point) extra_float_digits . . --filter=filename . --exclude-database . STDIN - . --filter --exclude-database . : exclude database PATTERN # (comment) . . . Patterns . --if-exists DROP ... IF EXISTS --clean . "does not exist" . --clean . --inserts INSERT ( COPY) . PostgreSQL . . --column-inserts . --load-via-partition-root COPY INSERT . . . text collation . --lock-wait-timeout=timeout . timeout . SET statement_timeout . --no-comments COMMENT . --no-data . --no-policies (row security policies) . --no-publications (publications) . --no-role-passwords (roles) . (null) . pg_roles pg_authid . pg_authid . --no-schema ( ) . --no-security-labels . --no-statistics . . --no-subscriptions (subscriptions) . --no-sync pg_dumpall . pg_dumpall . . --no-table-access-method . . --no-tablespaces tablespace tablespace . tablespace . --no-toast-compression TOAST . . --no-unlogged-table-data unlogged . () . --on-conflict-do-nothing ON CONFLICT DO NOTHING INSERT. --inserts --column-inserts . --quote-all-identifiers (). (major version) PostgreSQL pg_dumpall . pg_dumpall . . --quote-all-identifiers . --restrict-key=restrict_key \restrict psql . pg_dumpall . - . ( ) . psql . --rows-per-insert=nrows INSERT ( COPY). INSERT . . INSERT . --statistics (optimizer statistics). --statistics-only ( ) . (materialized views) . --sequence-data (sequence) . --no-data --schema-only --statistics-only . --use-set-session-authorization SQL SET SESSION AUTHORIZATION ALTER OWNER . . -? --help pg_dumpall . . -d connstr --dbname=connstr (connection string) . --dbname pg_dumpall . -l . -h host --host=host . (Unix domain socket) . PGHOST ( ) . -l dbname --database=dbname . postgres template1 . -p port --port=port TCP . PGPORT ( ) . -U username --username=username . -w --no-password . .pgpass . (batch jobs) . -W --password pg_dumpall . pg_dumpall . pg_dumpall . -W . . ~/.pgpass . --role=rolename . pg_dumpall SET ROLE rolename . ( -U) pg_dumpall . (superuser) . PGHOST PGOPTIONS PGPORT PGUSER PG_COLOR . always auto never. PostgreSQL libpq ( 32.15 ). (NOTES) pg_dumpall pg_dump pg_dump . --clean . --clean postgres template1 ( locale encoding) . . --statistics pg_dumpall . CREATE STATISTICS (CREATE_STATISTICS(7)) . ANALYZE . vacuumdb -a -z . . CREATE ROLE "role already exists" (bootstrap superuser) . . --clean --if-exists . pg_dumpall tablespace . pg_dumpall -X (--no-psqlrc) psql . pg_dumpall psql psql . (EXAMPLES) : $ pg_dumpall > db.out () : $ psql -X -f db.out -d postgres pg_dumpall . --clean postgres . (SEE ALSO) pg_dump(1) . PostgreSQL 18.6 2026 PG_DUMPALL(1)