| От | Bruno Wolff III |
|---|---|
| Тема | Re: Knowing when it is safe to call currval() |
| Дата | |
| Msg-id | 20030511044104.GA20184@wolff.to обсуждение |
| Ответ на | Knowing when it is safe to call currval() (Matthew Horoschun <mhoroschun@canprint.com.au>) |
| Список | pgsql-sql |
On Sun, May 11, 2003 at 14:11:01 +1000, Matthew Horoschun <mhoroschun@canprint.com.au> wrote: > Hi All, > > Is there any way to know ahead of time whether calling currval() on a > sequence will cause an exception like: > > ERROR: some_id_seq.currval is not yet defined in this session > > In my function I can't be sure whether nextval() will have previously > been called in the session. Well you could just call nextval at the start of the session to make sure it has a value. Howvere it is odd that you would want to call currval when there may not have already been a call to nextval. What are you doing with the returned value?
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера