Re: Disabling triggers / constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kell_pt(at)users(dot)sourceforge(dot)net
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disabling triggers / constraints
Date: 2004-05-21 17:51:17
Message-ID: 12234.1085161877@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Jorge Pereira <jrp(at)ideiaprima(dot)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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2004-05-21 19:07:26 Cancel/Kill backend functions
Previous Message Bruno Wolff III 2004-05-21 14:35:42 Re: pg_ctl patch to integrate apache's rotatelogs