Re: PL/pgSQL : notion of deferred execution

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-general(at)postgresql(dot)org
Subject: Re: PL/pgSQL : notion of deferred execution
Date: 2005-12-11 16:44:39
Message-ID: 17168.1134319479@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruno Wolff III <bruno(at)wolff(dot)to> writes:
> On Sun, Dec 11, 2005 at 16:31:59 +0100,
> Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> wrote:
>> Ratio: when deferred triggers on table A are used to calculate field values of
>> table B (which then obviously need an update), one might want to prevent
>> direct updates on these fields of table B

> It might also work for you to do this with access rights. The triggers can
> have different access rights than the user that caused the trigger to fire.

Yes. Keying this off whether the triggers are deferred or not seems
a fairly bizarre choice --- that's surely not the primary property that
should determine what they can do to table B. Also, it's quite unclear
which part of the system you expect to enforce the restriction against
which other part. The suggestion as stated seemed to be to let a
trigger find out whether it itself is being fired in a deferred fashion,
but surely you don't want to trust the trigger to decide whether it may
update B.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Foster, Stephen 2005-12-11 16:49:18 Re: [SQL] Looking for information on PostgreSQL Stored Procedures
Previous Message Douglas McNaught 2005-12-11 16:38:47 Re: [SQL] Looking for information on PostgreSQL Stored Procedures