You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two related problems when a partitioned parent has a FOR EACH ROW trigger (which PostgreSQL automatically clones onto every partition child, with pg_trigger.tgparentid set):
Qualified patterns in the [triggers] section ("<child_table>.<trigger_name>") do not match; only the unqualified trigger name matches. Since the cloned child triggers share the parent trigger's name, the only working ignore ("<trigger_name>") also unmanages the parent trigger.
Repro (pgschema 1.11.1, PostgreSQL 17)
CREATETABLEledger (
id uuid NOT NULL,
amount bigintNOT NULL,
ts timestamptzNOT NULL,
PRIMARY KEY (ts, id)
) PARTITION BY RANGE (ts);
CREATETABLEledger_2026_06 PARTITION OF ledger
FOR VALUESFROM ('2026-06-01') TO ('2026-07-01');
CREATEFUNCTIONtg_noop() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN RETURN NEW; END $$;
CREATETRIGGERtrg_rollup AFTER INSERT ON ledger
FOR EACH ROW EXECUTE FUNCTION tg_noop();
.pgschemaignore:
[tables]
patterns = ["ledger_2*"]
pgschema dump still contains CREATE OR REPLACE TRIGGER trg_rollup ... ON ledger_2026_06 -> plan --file <dump> fails with relation "ledger_2026_06" does not exist.
Adding [triggers] patterns = ["ledger_2*.trg_rollup"] does not filter it; patterns = ["trg_rollup"] does, but also removes the parent trigger from management.
Expected
Triggers with tgparentid != 0 (partition clones) are skipped in dump unconditionally - they are created automatically by PostgreSQL when the child is attached, mirroring the fix: skip internal per-partition FK constraints in dump (#409) #460 treatment of internal per-partition FK constraints.
Alternatively/additionally: [triggers] patterns support a table.trigger qualified form.
Observed on both 1.10.0 and 1.11.1 (Docker images), server PostgreSQL 17.
Summary
Two related problems when a partitioned parent has a
FOR EACH ROWtrigger (which PostgreSQL automatically clones onto every partition child, withpg_trigger.tgparentidset):dumpemits the cloned child triggers as standaloneCREATE OR REPLACE TRIGGER ... ON <child>statements even when the child tables are excluded via.pgschemaignore. The resulting desired-state file then fails pgschema's ownplanwithERROR: relation "<child>" does not exist, because the ignored child tables are absent from the temp schema. This is the trigger analog of Skipping privileges for specific functions with .pgschemaignore #392/fix: skip privileges for ignored objects in .pgschemaignore (#392) #393 (privileges of ignored objects) and skip constraints for foreign keys referencing ignored tables (.pgschemaignore) #409/fix: skip internal per-partition FK constraints in dump (#409) #460 (internal per-partition FK constraints).[triggers]section ("<child_table>.<trigger_name>") do not match; only the unqualified trigger name matches. Since the cloned child triggers share the parent trigger's name, the only working ignore ("<trigger_name>") also unmanages the parent trigger.Repro (pgschema 1.11.1, PostgreSQL 17)
.pgschemaignore:pgschema dumpstill containsCREATE OR REPLACE TRIGGER trg_rollup ... ON ledger_2026_06->plan --file <dump>fails withrelation "ledger_2026_06" does not exist.[triggers] patterns = ["ledger_2*.trg_rollup"]does not filter it;patterns = ["trg_rollup"]does, but also removes the parent trigger from management.Expected
tgparentid != 0(partition clones) are skipped indumpunconditionally - they are created automatically by PostgreSQL when the child is attached, mirroring the fix: skip internal per-partition FK constraints in dump (#409) #460 treatment of internal per-partition FK constraints.[triggers]patterns support atable.triggerqualified form.Observed on both 1.10.0 and 1.11.1 (Docker images), server PostgreSQL 17.