Skip to content

Add --exclude-table flag to ignore changes in certain tables#294

Open
andreyrusanov wants to merge 1 commit into
stripe:mainfrom
inboxbit:exclude-table-regex
Open

Add --exclude-table flag to ignore changes in certain tables#294
andreyrusanov wants to merge 1 commit into
stripe:mainfrom
inboxbit:exclude-table-regex

Conversation

@andreyrusanov

Copy link
Copy Markdown

Description

This PR adds the --exclude-table flag, which ignores changes in all tables whose names match the provided regular expression.

Motivation

I initially encountered a lack of support for partitioned tables, as well as issues with temporary tables in several non-production environments.
While partitioned tables require a more nuanced solution, the ability to ignore specific tables is a low-hanging fruit that addresses several pain points.

Testing

I tested commands like apply with --exclude-table flag, e.g.

./pg-schema-diff apply --to-dir /path/to/schema --from-dsn "postgresql://postgres@mydb:5432/db" --disable-plan-validation  --allow-hazards ACQUIRES_ACCESS_EXCLUSIVE_LOCK,DELETES_DATA,INDEX_BUILD,INDEX_DROPPED,ACQUIRES_ACCESS_EXCLUSIVE_LOCK,DELETES_DATA,HAS_UNTRACKABLE_DEPENDENCIES,IMPACTS_DATABASE_PERFORMANCE --exclude-table partitioned_table_\*

@cla-assistant

cla-assistant Bot commented Jun 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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