Re: Any idea for serializing INSERTING SERIAL column?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Any idea for serializing INSERTING SERIAL column?
Дата
Msg-id BANLkTikE9nZ0P7A6uymqX5LPb6jhHJL6GA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Any idea for serializing INSERTING SERIAL column?  (Tatsuo Ishii <ishii@postgresql.org>)
Список pgsql-hackers
On Wed, Jun 1, 2011 at 1:30 AM, Tatsuo Ishii <ishii@postgresql.org> wrote:
>> Problem with the advisory lock is, it will not work if the target
>> table is empty.
>
> Oops. I was wrong. the key for advisory lock needs to be a unique
> value, but not necessarily a row value in a table. Seems this is the
> way I should go(though need to be carefull since the lock is not
> released even after a transaction ends). Thanks!

9.1 has a transactional advisory lock (fyi).  I'd still consider
keeping to the old method because presumably you want the lock to be
as short as possible. Another big headache with advisory locks
unfortunately is lockspace conflicts between user code and library
(you) code -- I've actually seen this in the wild once.  Maybe you
could use the double int4 version and allow the users to supply the
other optional int4?

merlin


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: PQdeleteTuple function in libpq
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [DOCS] DOCS: SGML identifier may not exceed 44 characters