Re: sql insert function - Mailing list pgsql-general

From Richard Huxton
Subject Re: sql insert function
Date
Msg-id 200401131853.31515.dev@archonet.com
Whole thread Raw
In response to Re: sql insert function  ("Chris Ochs" <chris@paymentonline.com>)
List pgsql-general
On Tuesday 13 January 2004 17:46, Chris Ochs wrote:
> Yes it was in my function.  I thought the docs said that BEGIN and END had
> no effect on transactions though?  Plus wouldn't there have to be a
> transaction active since I was not using autocommit and the inserts did in
> fact commit?
>
> I suspect it is the end statement doing this though, I'll take it out and
> see what happens.

I think you're right - I looked back at your earlier posts and you are mixing
up plpgsql and sql function syntax (easy enough to do).

BEGIN...END bracket the body of a plpgsql function, but control a transaction
in the SQL function. The BEGIN would have been ignored, the END would have
committed the current transaction.

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: "Keith G. Murphy"
Date:
Subject: Re: Best practice? Web application: single PostgreSQL
Next
From: "scott.marlowe"
Date:
Subject: Re: Nested transaction - I am a bank ??