Re: Advisory Lock BIGINT Values - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Advisory Lock BIGINT Values
Date
Msg-id 1B123936-19A4-470E-B403-D135B409C3C5@justatheory.com
Whole thread Raw
In response to Re: Advisory Lock BIGINT Values  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: [v9.3] writable foreign tables
Next
From: Bruce Momjian
Date:
Subject: Re: Advisory Lock BIGINT Values