Re: Design question regarding arrays

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Design question regarding arrays
Дата
Msg-id 925EA687-E9EE-11D8-B87D-000A95C88220@myrealbox.com
обсуждение исходный текст
Ответ на Re: Design question regarding arrays  ("Sean Davis" <sdavis2@mail.nih.gov>)
Список pgsql-novice
On Aug 9, 2004, at 7:14 PM, Sean Davis wrote:

> I'm a novice, too, but why not look up the value in the sequence and
> increment it before doing any inserting?  If you are doing all the
> inserts
> at the same time (more or less), then you can just use this value in
> the
> insert into both tables.  Put all of this inside one transaction.

Actually, I don't even think it has to be inside a transaction. Beyond
being transaction safe, currval is session safe (correcting something I
said in an earlier post). As long as you don't put another insert or
otherwise manipulate the sequence in the same session, you can trust
currval

Michael Glaesemann
grzm myrealbox com


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Design question regarding arrays
Следующее
От: Oliver Fromme
Дата:
Сообщение: Re: Design question regarding arrays