Re: [HACKERS] Advisory Lock BIGINT Values

2012-08-28 Thread Bruce Momjian
On Mon, Aug 27, 2012 at 11:56:32PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Fri, Mar 9, 2012 at 04:36:08PM -0800, David E. Wheeler wrote: > >> A bigint key is displayed with its > >> high-order half in the classid column, its low-order > >> half > >> in the objid colu

Re: [HACKERS] Advisory Lock BIGINT Values

2012-08-28 Thread David E. Wheeler
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

Re: [HACKERS] Advisory Lock BIGINT Values

2012-08-27 Thread Tom Lane
Bruce Momjian writes: > On Fri, Mar 9, 2012 at 04:36:08PM -0800, David E. Wheeler wrote: >> A bigint key is displayed with its >> high-order half in the classid column, its low-order >> half >> in the objid column, and objsubid equal >> !to 1. The original bigint value can be

Re: [HACKERS] Advisory Lock BIGINT Values

2012-08-27 Thread Bruce Momjian
On Fri, Mar 9, 2012 at 04:36:08PM -0800, David E. Wheeler wrote: > Hackers, > > The documentation for pg_locks says that, for BIGINT advisory locks: > > > A bigint key is displayed with its high-order half in the classid column, > > its low-order half in the objid column > > I was in need of k

[HACKERS] Advisory Lock BIGINT Values

2012-03-09 Thread David E. Wheeler
Hackers, The documentation for pg_locks says that, for BIGINT advisory locks: > A bigint key is displayed with its high-order half in the classid column, its > low-order half in the objid column I was in need of knowing what the bigint is that is waiting on a lock, and Andrew Dunstan was kind