Re: Weird error message in SQL function call - Mailing list pgsql-general

From Vincenzo Romano
Subject Re: Weird error message in SQL function call
Date
Msg-id 200707161453.38639.vincenzo.romano@gmail.com
Whole thread Raw
In response to Re: Weird error message in SQL function call  (Richard Huxton <dev@archonet.com>)
List pgsql-general
On Monday 16 July 2007 12:18:23 Richard Huxton wrote:
> Vincenzo Romano wrote:
> > Hi all.
> >
> > I've got this error message while running an SQL function:
> >
> > ---- BEGIN
> > psql:filtb.sql:1029: ERROR:  COMMIT is not allowed in a SQL
> > function CONTEXT:  SQL function "f_relazione" during startup
> > funzione SQL "f_relazione" istruzione 1
> > ----  END
> >
> > Of course, I have no COMMIT command either in the function itself
> > or in any other function called by f_relazione().
>
> Seeing as you are reading in a large .sql file, I'd look for a
> quoting error - if the closing quote for the function-body isn't
> correct it'll run on, and then encounter a COMMIT further down the
> file.

You hit the spot!

The actual problem was in a deeper function body that used to be
PgPLSQL and is now SQL.
A spurious "END;" in the end of the body was being interpreted as a
COMMIT;

Thanks.

--
Vincenzo Romano
--
Maybe Computer will never become as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1988]

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Weird error message in SQL function call
Next
From: Rajarshi Guha
Date:
Subject: Re: count the number of bits set to 1 in a bit string field