Re: Weird error message in SQL function call

Поиск
Список
Период
Сортировка
От Vincenzo Romano
Тема Re: Weird error message in SQL function call
Дата
Msg-id 200707161453.38639.vincenzo.romano@gmail.com
обсуждение исходный текст
Ответ на Re: Weird error message in SQL function call  (Richard Huxton <dev@archonet.com>)
Список 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 по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Weird error message in SQL function call
Следующее
От: Rajarshi Guha
Дата:
Сообщение: Re: count the number of bits set to 1 in a bit string field