Re: LOCK for non-tables - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: LOCK for non-tables
Date
Msg-id 20110112.094319.102092897291462396.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: LOCK for non-tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> In the SEQUENCE example above, SELECT ... FOR UPDATE is certainly not
> adequate to protect the sequence against DDL-level changes.  Fortunately
> sequences don't have too many DDL commands, but still an ALTER RENAME
> might be enough to confuse pg_dump.
> 
> (By the way, does that SELECT ... FOR UPDATE actually accomplish
> anything at all?  nextval() doesn't go through heap_update, and neither
> does ALTER SEQUENCE, so I'd be a bit surprised if it really manages to
> block changes to the sequence.)

Of course "SELECT ... FOR UPDATE" does not block nextval().  It just
blocks concurrent "SELECT ... FOR UPDATE" in other session. This is
enough for pgpool's use case.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Something fishy about the current Makefiles
Next
From: Andrew Dunstan
Date:
Subject: Re: arrays as pl/perl input arguments [PATCH]