Re: Any idea for serializing INSERTING SERIAL column?

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: schmiddy(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Any idea for serializing INSERTING SERIAL column?
Date: 2011-06-01 06:30:44
Message-ID: 20110601.153044.857710717416464421.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> Sorry, I'm not real familiar with pgpool, but have you thought about
>> using an advisory lock on the target table, instead of a "real" lock
>> (SELECT ... FOR UPDATE / LOCK table)? An advisory lock should not
>> interfere with autovacuum. Obviously, this would only work if all the
>> INSERTs in your example were coming from a single application (i.e.
>> pgpool) which would honor the advisory lock.
>
> 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!
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2011-06-01 07:03:29 Re: patch for new feature: Buffer Cache Hibernation
Previous Message Peter Eisentraut 2011-06-01 04:24:31 Re: Getting a bug tracker for the Postgres project