Re: Are rules transaction safe? - Mailing list pgsql-general

From Doug McNaught
Subject Re: Are rules transaction safe?
Date
Msg-id 87mzhhcrmi.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to Are rules transaction safe?  (Oliver Fürst <ofuerst@tsak.net>)
Responses Re: Are rules transaction safe?
List pgsql-general
Oliver Fürst <ofuerst@tsak.net> writes:

> Hi all,
>
> I have a question regarding rules on views. Are the commands inside a
> ON INSERT (or UPDATE) DO INSTEAD (implicit) transactions for postgres?
> I tried to put BEGIN; and COMMIT; around the commands in a ON ... DO
> INSTEAD ( ) block, but keep getting a syntax error.

Everything that happens in Postgres is inside either an implicit or
explicit transaction, so you can't do BEGIN/COMMIT inside rules or
functions.

You might be able to use savepoints, depending on what you're actually
trying to do.

-Doug

pgsql-general by date:

Previous
From: Oliver Fürst
Date:
Subject: Are rules transaction safe?
Next
From: Dave E Martin
Date:
Subject: parameter substitution problem in jdbc driver? (8.1)