Alvaro Herrera wrote:
> 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.

You could add another level of indirection, e.g by adding a new table
that maps the string to a bigint. I doubt it's worth the effort and
performance impact, though. Cleaning up old unused rows from the table
etc. would require a fair amount of work.

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to