currval() within one statement

Поиск
Список
Период
Сортировка
От silly_sad
Тема currval() within one statement
Дата
Msg-id 4795984E.7030904@bankir.ru
обсуждение исходный текст
Ответы Re: currval() within one statement
Re: currval() within one statement
Список pgsql-sql
Helo

is it expected that the currval() changes its value between calls within 
one statement ?

Look the following call:

INSERT INTO ttt (a,b) SELECT currval('ttt_id_seq'), 'const' FROM ttt2;

Where the trigger before insert on ttt is defined and this trigger calls  nextval('ttt_id_seq').

I was surprised having different values of currval() in ttt.a

Is this the normal behavior ? Where is it described ?


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