From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | James Gregory <james(at)anchor(dot)net(dot)au> |
Cc: | Postgresql General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: nested transactions |
Date: | 2003-03-14 04:51:30 |
Message-ID: | 20030314045130.GB32098@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Stored procedures are always within a single block. They inherit whatever
transaction from the caller. If there is an error, it rollbacks your
function (and the callers too IIRC).
On Fri, Mar 14, 2003 at 03:11:47PM +0000, James Gregory wrote:
> Hi all,
>
> I am writing a stored procedure where it is absolutely necessary that it
> be executed within a single transaction block. Now, postgres doesn't
> support nested transactions, and that's ok, it's not really what I want.
> I want to know how to test whether or not a piece of sql that is
> executing is doing so inside a transaction. If it is, I'll let it be,
> otherwise I want to set a flag to start one and commit at the end of the
> function.
>
> Is there a way to do this?
>
> Thanks,
>
> James.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Support bacteria! They're the only culture some people have.
From | Date | Subject | |
---|---|---|---|
Next Message | shreedhar | 2003-03-14 06:25:28 | Is there any tool to set up database automatically |
Previous Message | Andres Montiel | 2003-03-14 04:15:49 | embedding PostgreSQL in a Java application |