Re: Disabling triggers / constraints - Mailing list pgsql-patches

From Tom Lane
Subject Re: Disabling triggers / constraints
Date
Msg-id 12234.1085161877@sss.pgh.pa.us
Whole thread Raw
In response to Re: Disabling triggers / constraints  (Jorge Pereira <jrp@ideiaprima.com>)
List pgsql-patches
Jorge Pereira <jrp@ideiaprima.com> writes:
> I can understand your concerns. But for the sake of context for context,
> here's an example of the code generated by pg_dump --disable-triggers:

I'm well aware of what pg_dump does.  Please observe that what it does
(a) affects only one table at a time, and (b) requires superuser
privileges.

> What I propose is

> | SET disable_triggers=1;
> | -- INSERT / UPDATE statements;
> | SET disable_triggers=0;

This is totally unsafe, the more so the more triggers you have.

> I don't see a need to do it on a per-table basis,

Security: a global disable may break things you didn't even know
existed.  In particular I do not wish to see such a feature able to
disable triggers on tables you don't own.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: pg_ctl patch to integrate apache's rotatelogs
Next
From: "Magnus Hagander"
Date:
Subject: Cancel/Kill backend functions