Re: transactions in plpgsql

From: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: transactions in plpgsql
Date: 2004-03-20 12:23:23
Message-ID: 200403200923.23718.martin@bugs.unl.edu.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El Vie 19 Mar 2004 12:49, Richard Huxton escribió:
> On Friday 19 March 2004 13:01, Martin Marques wrote:
> > I'm building some functions in plpgsql, and I got to a point where I
> > thought: How are transactions used in the function? Is it posible to
> > rollback the modifications that were made to the tables at some point in
> > the plpgsql function?
>
> You can abort the entire transaction by raising an exception. Nothing more
> sophisticated is available at the moment.

OK, this would mean that the whole function is in a transaction. But what if I
call another function from within this one and it that function gets an error
which is RAISED? Can I do something about it on the original function, or do
I have to let it all rollback?

--
09:19:02 up 11 days, 13:50, 2 users, load average: 1.13, 0.88, 0.38
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2004-03-20 12:51:40 Re: Post to hacker list
Previous Message Carsten B. Jensen 2004-03-20 11:00:47 FATAL: Can't read lock file /tmp/.s.PGSQL.5432.lock: Access denied