Re: Parse error help needed... - Mailing list pgsql-general

From Richard Huxton
Subject Re: Parse error help needed...
Date
Msg-id 200401131142.44354.dev@archonet.com
Whole thread Raw
In response to Re: Parse error help needed...  ("Thapliyal, Deepak" <dthapliyal@soe.sony.com>)
Responses Re: Parse error help needed...
List pgsql-general
On Tuesday 13 January 2004 01:39, Thapliyal, Deepak wrote:
> Now my function is created ... Thanks guys ..
>
> Now getting error while trying to execute it
>
> postgres=# select loadme();
> WARNING:  Error occurred while executing PL/pgSQL function loadme
> WARNING:  line 7 at SQL statement
> ERROR:  SPI_prepare() failed on "commit"

Remove the "commit" line - functions cannot define their own transactions
anyway. I guess you're being misled by the "begin" line - it's matched by the
"end" and defines the function body rather than any transaction.

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: sql insert function
Next
From: Anton.Nikiforov@loteco.ru
Date:
Subject: Re: insertion with trigger failed unexpectedly