Re: Test to see if currval will fail?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Test to see if currval will fail?
Дата
Msg-id web-2023196@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Test to see if currval will fail?  (Kelly McDonald <w4kpm@adelphia.net>)
Ответы Re: Test to see if currval will fail?
Список pgsql-novice
Kelly,

> Is there a test to see if a call to currval will fail? I would like
> to
> call nextval one time per session inside a trigger. I am working on
> other solutions, but I searched the docs and didn't find what I was
> looking for.

You could do "select last_value from <sequence name>" instead.
 However, I'm not sure that that method of getting the currval is
session-protected in the way that currval is.

-Josh Berkus

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