[Q] Sequences, last_value and inserts

Поиск
Список
Период
Сортировка
От Roderick A. Anderson
Тема [Q] Sequences, last_value and inserts
Дата
Msg-id Pine.LNX.4.33.0211011136340.16136-100000@main.cyber-office.net
обсуждение исходный текст
Ответы Re: [Q] Sequences, last_value and inserts  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
PostgreSQL 7.2.1
RHL 7.3
DBI, DBD::Pg

I'm inserting some values into a table with a serial field.  This is being
done using Perl and the DBI.  I then pull back using 'last_value' what I
hope is the value for the insert. The thought came to mind that if the
database is getting hit pretty hard there may be another access of the
sequence and last_value will be wrong 'for me'.
   Question is how do I insure I get the correct last-value?  Enclose in a
BEGIN/END block?  (How's that done using Perl? - my DBI book isn't at
hand).


TIA,
Rod
--
  "Open Source Software - Sometimes you get more than you paid for..."


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

Предыдущее
От: Patrick Bakker
Дата:
Сообщение: Re: Questions on specifying table relationships
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: [Q] Sequences, last_value and inserts