Re: RULE vs TRIGGER

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: RULE vs TRIGGER
Date: 2001-07-31 23:31:15
Message-ID: 20010731183115.D27771@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 31, 2001 at 11:05:37AM -0700, Stephan Szabo wrote:
> I meant using a lock table statement explicitly at the
> beginning of the trigger (LOCK TABLE tbl; -- possibly
> would have to be through execute, I'm not sure) which
> I would presume would mean that the "second" would
> have to wait at that point until the first transaction
> finished completely. Of course this cuts down your
> concurrency as only one transaction calling this would
> be able to run and the rest would have to wait.

hmm. so, how about

create rule
add_new_item as
on insert to fake_view
do instead (
begin work;
lock table _real_data;
insert into _real_data ( ... ) values ( ... );
commit work;
);

would something like this be legal...? (i.e. what's the syntax
necessary to make it happen behind-the-scenes?)

--
Khan said that revenge is a dish best served cold. I think
sometimes it's best served hot, chunky, and foaming.
- P.J.Lee ('79-'80)

will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Richardson 2001-08-01 00:09:32 Re: Sequences and inheritance
Previous Message Nicholas Piper 2001-07-31 22:41:04 Re: Really slow UPDATE and DELETE