Re: Advisory Lock BIGINT Values

David E. Wheeler <david@justatheory.com>

From: "David E. Wheeler" <david@justatheory.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <bruce@momjian.us>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2012-08-28T16:14:47Z
Lists: pgsql-hackers
On Aug 27, 2012, at 8:56 PM, Tom Lane wrote:

> This formula is not actually correct, as you'd soon find out if you
> experimented with values with the high-order bit of the low-order word
> set.  (Hint: sign extension.)
> 
> The correct formula is both simpler and far more efficient:
> 
> (classid::int8 << 32) | objid::int8
> 
> This works because oidtoi8 correctly treats the OID value as unsigned.

Oh, nice, thanks!

David