Cannot do this, as currently there is no support for nested transactions.
On Mon, 9 Jul 2001, Fabrizio Mazzoni wrote:
> 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;
> );
>
> But when i give this command in psql i always get an error..
>
> Regards
>
> fabrizio@macrongolf.com
> http://macrongolf.com
> http://eteampoint.com
> http://macron.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
>