Re: LOCK for non-tables

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: robertmhaas(at)gmail(dot)com, ishii(at)postgresql(dot)org, fgp(at)phlo(dot)org, simon(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: LOCK for non-tables
Date: 2011-01-12 00:43:19
Message-ID: 20110112.094319.102092897291462396.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-01-12 00:55:49 Re: arrays as pl/perl input arguments [PATCH]
Previous Message Jeff Davis 2011-01-12 00:18:59 Re: Something fishy about the current Makefiles