Re: Are rules transaction safe?

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Oliver Fürst <ofuerst(at)tsak(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Are rules transaction safe?
Date: 2006-01-27 21:01:25
Message-ID: 87mzhhcrmi.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oliver Fürst <ofuerst(at)tsak(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave E Martin 2006-01-27 21:13:00 parameter substitution problem in jdbc driver? (8.1)
Previous Message Oliver Fürst 2006-01-27 20:48:29 Are rules transaction safe?