Re: age(xid) function bug - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: age(xid) function bug
Date
Msg-id 200808200406.m7K46eb01937@momjian.us
Whole thread Raw
In response to Re: age(xid) function bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > However, the function only does a subtraction with no adjustment for
> > overflow, and considering it returns a signed int, it can't even display
> > the full range of valid values:
> 
> Say again?  The possible range of ages is only 2 billion.

If we assume that only xid stored in actual tables are used, yes:
test=> select txid_current(); txid_current--------------          402(1 row)test=> select age('4294967290'::xid);
age-----409(1 row)
 

OK, so it does work based on the limitations we place on stored xids.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Make the pg_stat_activity view call a SRF
Next
From: Bruce Momjian
Date:
Subject: Re: A smaller default postgresql.conf