Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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!


In response to

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group