pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Din Adrian <adrian.din@easynet.ro>
To: Marian POPESCU <softexpert@libertysurf.fr>
To: pgsql-sql@postgresql.org
Subject: Re: transaction in function
Date: Tue, 05 Dec 2006 22:32:16 +0200
Message-ID: <op.tj3sn2cmawcxfg@adin> (raw)
In-Reply-To: <el431c$9mt$1@sea.gmane.org>
References: <el431c$9mt$1@sea.gmane.org>

Any function runs into a single transaction so you don't need to worry  
about rolling back on exceptions - this is the standard behavior. If there  
is an exception while running any statement   inside the function it's  
rolls back automatically.


On Tue, 05 Dec 2006 17:25:31 +0200, Marian POPESCU  
<softexpert@libertysurf.fr> wrote:

> Hi,
>
> I want to write a function that updates several tables; if there is an
> exception while updating, it should rollback the transaction and raise an
> error.
>
> How can this be done in pgPLSQL in PostgreSQL 8.1 ?
>
> Thank you for helping me out on this one !
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



view thread (4+ messages)

Message-ID: <op.tj3sn2cmawcxfg@adin>
Permalink:  ../op.tj3sn2cmawcxfg@adin/
Also on:    postgresql.org/message-id/op.tj3sn2cmawcxfg@adin

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: adrian.din@easynet.ro, softexpert@libertysurf.fr
  Subject: Re: transaction in function
  In-Reply-To: <op.tj3sn2cmawcxfg@adin>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox