| От | Tom Lane |
|---|---|
| Тема | Re: Use of nextval, currval |
| Дата | |
| Msg-id | 3343.1036740563@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Use of nextval, currval ("Josh Berkus" <josh@agliodbs.com>) |
| Список | pgsql-novice |
"Josh Berkus" <josh@agliodbs.com> writes:
>> I believe that I can replace this in Postgres with:
>>
>> insert into TABLE (id1,.......,id2)
>> values (nextval('DataId'),.....,currval('DataId');
>>
>> What I think is expected is that the values of id1 and id2 will be
>> equal.
> This is correct.
Well ... it's relying on the assumption that the elements of the VALUES
list will be evaluated left-to-right. Which is true at the moment,
and I don't really expect it to change, but it still could be called an
unsafe dependency on undocumented implementation details. I doubt you
will find anything in the SQL spec that requires implementations to
behave that way.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера