Re: Transactions in rules..

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Fabrizio Mazzoni <fabrizio(at)macron(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Transactions in rules..
Date: 2001-07-09 15:52:55
Message-ID: Pine.LNX.4.30.0107091751220.677-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Fabrizio Mazzoni writes:

> Can i use transactions in rules??
> I was trying something like:
>
> create rule x_test as
> on insert to view1
> do instead
> (
> begin;
> insert into test1 values (new.a,new.b);
> insert into test2 values (new.c,new.d);
> commit;
> );

The statements added by the rule will automatically be executed in the
same one transaction as the original statement that fired the rule. Your
syntax example would sort of invoke a nested transaction, which doesn't
exist. All in all, you don't need to worry about it.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Berger 2001-07-09 16:00:49 Re: Re: query optimizer questions
Previous Message Peter Eisentraut 2001-07-09 15:49:10 Re: problem in compilation.