Re: Advisory Lock BIGINT Values

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Advisory Lock BIGINT Values
Date: 2012-08-28 16:14:47
Message-ID: 1B123936-19A4-470E-B403-D135B409C3C5@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-08-28 16:17:42 Re: Advisory Lock BIGINT Values
Previous Message Kohei KaiGai 2012-08-28 16:08:59 Re: [v9.3] writable foreign tables