Re: Change lock requirements for adding a trigger

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Decibel! <decibel(at)decibel(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change lock requirements for adding a trigger
Date: 2008-06-04 20:33:20
Message-ID: 29221.1212611600@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> We have
> * relhasindex (bool) set by CREATE INDEX but not unset by DROP INDEX
> * relhasrules (bool)
> * reltriggers (int2) set by CREATE and DROP, since its an integer

Right.

> If CREATE INDEX can take a Share lock and can update pg_class, why would
> it not be theoretically possible for CREATE TRIGGER?

It's (probably) theoretically possible, if we replace reltriggers with a
bool that acts more like relhasindex, ie it's a hint to go look in
pg_triggers. My point was just that you can't arbitrarily decide that
some operation needs only a given strength of lock if you are not up to
speed on these sorts of details.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2008-06-04 20:34:01 Re: Proposal: new function array_init
Previous Message Pavel Stehule 2008-06-04 20:31:27 Re: Overhauling GUCS