Re: psql sequence question

Поиск
Список
Период
Сортировка
От Ernest E Vogelsinger
Тема Re: psql sequence question
Дата
Msg-id 5.1.1.6.2.20030616202213.03ce7be0@mail.vogelsinger.at
обсуждение исходный текст
Ответ на psql sequence question  (Jodi Kanter <jkanter@virginia.edu>)
Список pgsql-admin
At 17:24 16.06.2003, Jodi Kanter said:
--------------------[snip]--------------------

>If I'm using transactions (not autocommit), are sequences atomic?

Yes

>In other words, after inserting a record to a table that
>uses sequence A, am I guaranteed that select last_value on
>sequence A is atomic, and cannot be interfered with by other
>transactions using that same sequence? Sequence A is used by
>several tables.

Yes. But you should use currval('seq_name') since this guarantees to return
the last value returned to the current connection. Check the recent posts -
there was a discussion on just this topic.

--
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Error: Relation "pg_rel_check" does not exist
Следующее
От: Tom Lane
Дата:
Сообщение: Re: how do I get rid of huge sorttemp files?