[Pgpool-hackers] Idea to handle sequences

Jaime Casanova jaime at 2ndquadrant.com
Sat Jan 8 21:15:42 UTC 2011


On Fri, Jan 7, 2011 at 10:24 PM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>> On Fri, Jan 7, 2011 at 5:46 AM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>>>
>>> On master we do:
>>>
>>> BEGIN;
>>> SELECT 1 FROM t1_i_seq FOR UPDATE;
>>
>> and why you are allowed to execute FOR UPDATE in a sequence? i mean,
>> if you can't lock the secuence it has no sense that you can lock the
>> rows on it... is it not a postgres bug that we should report instead
>> of exploit it?
>
> Not sure I want to report it. The "bug" does not hurt PostgreSQL users
> in any sense, for example security issues.
>
> Theoreticaly we could fix this "bug" and provide "formal" way to lock
> sequences instead. But I doubt PostgreSQL cores agree to provide such
> new API, which is probably only benefitical to pgpool users.
>

Actually, Robert Haas has just proposed to add LOCK for non-table
objects (http://archives.postgresql.org/pgsql-hackers/2011-01/msg00472.php).
Last part of that thread is Robert asking for another use case (there
are already 2 use cases, not sure how valid they are though).

So, this could be one more use case. Probably you can also ask to keep
FOR UPDATE, and if core agree on not change current misbehaviour...
you won't be praising all days that this inconsistency is not found...

-- 
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL


More information about the Pgpool-hackers mailing list