pg_dump with disable trigger - Mailing list pgsql-bugs

From Soni M
Subject pg_dump with disable trigger
Date
Msg-id CAAMgDXneQvt1yX6u7XL=LBrAPU1D=tRKCgz6_JGL7+VBHNB5mQ@mail.gmail.com
Whole thread Raw
Responses Re: pg_dump with disable trigger
List pgsql-bugs
Hello All,

I think I found bug on pg_dump 9.6.8.
The bug arise when using pg_dump with --disable-trigger option.
The command just :
pg_dump -f /tmp/test_disable_trigger.sql -a -b --disable-triggers -t some_table some_database
On the resulted script, it simply did

ALTER TABLE public.some_table DISABLE TRIGGER ALL;
COPY command
ALTER TABLE public.some_table ENABLE TRIGGER ALL;

This become a problem, when the destination table already has Disabled user triggers, it gets enabled by the dump script.
It also altered another kind of trigger like Triggers firing on replica only, get altered to ordinary triggers.

Thanks

--
Regards,

Soni Maula Harriz

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()
Next
From: "David G. Johnston"
Date:
Subject: Re: pg_dump with disable trigger