Re: Proposal: String key space for advisory locks

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: String key space for advisory locks
Date: 2009-10-26 13:11:39
Message-ID: 20091026131139.GB8812@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-10-26 13:12:17 Re: Parsing config files in a directory
Previous Message Simon Riggs 2009-10-26 13:08:00 Re: License clarification: BSD vs MIT