Re: psql sqlstate return code access

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема Re: psql sqlstate return code access
Дата
Msg-id CAKoxK+7jtk7QspcB0ZS_g_V00eMrrsGFXK-PR7uxu+D=2vYOoQ@mail.gmail.com
обсуждение исходный текст
Ответ на psql sqlstate return code access  ("Little, Doug C" <Doug.Little@vend.frb.org>)
Список pgsql-general
On Mon, Mar 16, 2015 at 4:23 PM, Little, Doug C
<Doug.Little@vend.frb.org> wrote:
> insert into x select … from y;
>
>
>
> insert into log(message, code,timestamp)  values('insert into
> x',:SQLSTATE,now());
>
>

I'm pretty sure you have to wrap it into a plpgsql function:
http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html
Moreover, if the command executes correctly you would have no
exception and sql state will be 0.

Hope this helps.

Luca


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

Предыдущее
От: Rob Richardson
Дата:
Сообщение: Re: Update using non-existent fields does not throw an error
Следующее
От: Bill Brown
Дата:
Сообщение: Postgresql BDR(Bi-Directional Replication) Latency Monitoring