postgres icon indicating copy to clipboard operation
postgres copied to clipboard

pg_dump: Add --schema-no-create option [PG17]

Open NanoBjorn opened this issue 8 months ago • 2 comments

Adds a new --schema-no-create option to pg_dump that allows dumping schema data without generating CREATE SCHEMA statements. When this option is used, the specified schema is automatically included in the dump but the schema creation statement is skipped, allowing data to be imported into existing schemas.

This option is used by the Neon fast import feature (PR #11908) to allow migrations of only objects in certain schemas.

Usage: pg_dump --schema-no-create=schema_name database_name

NanoBjorn avatar Jun 16 '25 12:06 NanoBjorn

Can't you just filter CREATE SCHEMA statements from the output?

MMeent avatar Jun 16 '25 13:06 MMeent

Unrelated to the above: please use --no-<option-name> instead of --<option>-no-<name>, as that is easier to understand.

MMeent avatar Jun 16 '25 13:06 MMeent