pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mauri Sahlberg <Mauri.Sahlberg@claymountain.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Stupid question about triggers
Date: Fri, 09 Sep 2005 16:20:21 +0300
Message-ID: <43218C15.1070704@claymountain.com> (raw)

Hi,

I have found myself in a situation where I need to quickly delete rows
from a production database. Unfortunately table for the rows to be
deleted have triggers which results massive chain of update operations
on other tables. I do not wish those to happen as I'm about to delete
concerned rows from the other tables as well. (7.4.7)

Would

begin work
select reltriggers from pg_class where relname='foo' for update;
update pg_class set reltriggers=0 where relname='foo';
delete from foo where ...
update pg_class set reltriggers=original value where relname='foo';
commit

work?

Or
begin work
select reltriggers from pg_class where relname='foo';
update pg_class set reltriggers=0 where relname='foo';
delete from foo where ...
update pg_class set reltriggers=original value where relname='foo';
commit

as I'm quite sure the number of triggers for that table will not change
while I'm doing the deletion.

Thank you.




view thread (3+ messages)  latest in thread

Message-ID: <43218C15.1070704@claymountain.com>
Permalink:  ../43218C15.1070704@claymountain.com/
Also on:    postgresql.org/message-id/43218C15.1070704@claymountain.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: Mauri.Sahlberg@claymountain.com
  Subject: Re: Stupid question about triggers
  In-Reply-To: <43218C15.1070704@claymountain.com>
  References: <43218C15.1070704@claymountain.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox