Re: disable triggers isolated to transaction only?

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: disable triggers isolated to transaction only?
Date: 2010-03-03 15:46:14
Message-ID: c20510f5be73da938956bb41695c73f6@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> My question is this: will ALTER TABLE ONLY $subtable DISABLE TRIGGER
> ALL within a transaction only affect my transaction, or will it affect
> anyone inserting into this subtable. If it blocks external inserts
> that's ok since my transactions are small while moving the data. I
> guess at worse I lock the table.

ALTER TABLE will lock and block, but I'd be remiss if I didn't point
out the use of session_replication_role as a much better solution to
this particular class of problem. (Even if your version does not
support it, Vick, it should be noted here for the archives). The
session_replication_role was added in 8.3:

http://www.postgresql.org/docs/8.3/interactive/sql-altertable.html

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201003031020
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkuOhDYACgkQvJuQZxSWSsiPxwCg1JGjrfxvv0gmJDJPGCd2pLdE
X0sAn3t+IYPnAIPcZqqxtBIaUUbkm1jL
=US8W
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2010-03-03 15:50:03 Re: disable triggers isolated to transaction only?
Previous Message Ivan Sergio Borgonovo 2010-03-03 15:41:26 Re: bug in function arguments "recognition"