Skip to content

Add POSTGRES_EXTRA_DUMP_OPTS for extra pg_dump arguments#25

Open
n1mmy wants to merge 1 commit into
itbm:masterfrom
n1mmy:upstream/extra-dump-opts
Open

Add POSTGRES_EXTRA_DUMP_OPTS for extra pg_dump arguments#25
n1mmy wants to merge 1 commit into
itbm:masterfrom
n1mmy:upstream/extra-dump-opts

Conversation

@n1mmy

@n1mmy n1mmy commented May 5, 2026

Copy link
Copy Markdown

Summary

Adds a new POSTGRES_EXTRA_DUMP_OPTS environment variable that is passed through to pg_dump/pg_dumpall invocations in backup.sh. This allows passing dump-specific flags such as --exclude-table=public.foo or --exclude-table-data=public.sessions without affecting connection-level options.

Why a separate variable from POSTGRES_EXTRA_OPTS?

POSTGRES_EXTRA_OPTS already feeds into POSTGRES_HOST_OPTS, which is reused by psql/pg_restore in restore.sh. Dump-only flags like --exclude-table would break those callers, so they need their own variable.

Changes

  • Dockerfile: declare POSTGRES_EXTRA_DUMP_OPTS with empty default
  • backup.sh: thread $POSTGRES_EXTRA_DUMP_OPTS into all three dump invocations (custom format, pg_dumpall, plain pg_dump)
  • README.md: document the new variable

Example

docker run ... -e POSTGRES_EXTRA_DUMP_OPTS="--exclude-table=public.audit_log" ...

Allows passing dump-specific flags such as --exclude-table without
affecting the connection options reused by psql/pg_restore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant