Re: [INTERFACES] pl/pgSQL & transaction

Поиск
Список
Период
Сортировка
От Cedar Cox
Тема Re: [INTERFACES] pl/pgSQL & transaction
Дата
Msg-id Pine.LNX.4.21.0101191339290.6940-100000@nanu.visionforisrael.com
обсуждение исходный текст
Ответ на pl/pgSQL & transaction  ("Zolof" <zolof@club-internet.fr>)
Список pgsql-general

On Thu, 18 Jan 2001, Zolof wrote:

> This code doesn't work. I use Begin Work to start a transaction but BEGIN is
> a PL/pgSQL command so I have a parse error when executing it.
>
> CREATE FUNCTION a () RETURNS int4 AS '
> BEGIN
>    BEGIN WORK;
>    COMMIT WORK;
>     return 1;
>     END;
> ' LANGUAGE 'plpgsql';
>
> What's wrong ????

You didn't read the documentation.

"It is important not to misunderstand the meaning of BEGIN/END for
grouping statements in PL/pgSQL and the database commands for transaction
control. Functions and trigger procedures cannot start or commit
transactions and Postgres does not have nested transactions. "



В списке pgsql-general по дате отправления:

Предыдущее
От: "Marcel Gsteiger"
Дата:
Сообщение: Antw: Re: Why does the JDBC driver not support prepareCall?
Следующее
От: Ian Harding
Дата:
Сообщение: Re: Multiple columns w/single aggregate