Re: Proposal: String key space for advisory locks - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Proposal: String key space for advisory locks
Date
Msg-id 20091026131139.GB8812@alvh.no-ip.org
Whole thread Raw
In response to Proposal: String key space for advisory locks  (Christophe Pettus <xof@thebuild.com>)
Responses Re: Proposal: String key space for advisory locks
List pgsql-hackers
Christophe Pettus wrote:

> API Changes:
> 
> Overloading the various advisory lock functions to take a suitable
> string type (varchar(64)?) in addition to the bigint / 2 x int
> variations.  As with the bigint / 2 x int forms, this string
> namespace would be disjoint from the other key spaces.

I don't think this can be made to work.  The locktag hash element has a
fixed size.  Perhaps you could make it work if you hashed the string and
used that as a locktag, but it would lock too much as soon as two
strings had matching hashes.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Parsing config files in a directory
Next
From: Robert Haas
Date:
Subject: Re: Parsing config files in a directory