Behavior of nextval() and currval()

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Behavior of nextval() and currval()
Дата
Msg-id 3BF11280.DAAB8812@mascari.com
обсуждение исходный текст
Ответы Re: Behavior of nextval() and currval()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Behavior of nextval() and currval()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
The following works in 7.1. Is this behavior guaranteed or is it the
subject of possible change in the future? Or am I just "getting
lucky" that nextval() is evaluated before currval():

CREATE SEQUENCE s;

CREATE TABLE test (
key1 int4,
key2 int4
);

INSERT INTO test
SELECT nextval('s'), currval('s');

SELECT * FROM test;

 key1 | key2
------+------
    1 |    1

Thanks for any information,

Mike Mascari
mascarm@mascari.com

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

Предыдущее
От: Justin Clift
Дата:
Сообщение: Re: Is data storage secure?
Следующее
От: Marcelo Pereira
Дата:
Сообщение: Create Table