| From: | Robert Haas <robertmhaas(at)gmail(dot)com> | 
|---|---|
| To: | Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> | 
| Cc: | Pg Hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: Change behavior of (m)xid_age | 
| Date: | 2015-10-22 21:18:50 | 
| Message-ID: | CA+TgmobEBRH6MydCeb6Yfx3=VmMRT7shHLU8O1fSdurB-ykPxA@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Wed, Oct 21, 2015 at 1:33 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> Currently, xid_age() returns INT_MAX for a permanent xid. The comment in the
> function that 'Permanent XIDs are always infinitely old' may be technically
> correct, but returning INT_MAX is a useless behavior because it actually
> makes it look like that XID is in immediate wraparound danger. I think we
> should change it to return either 0, -1, or INT_MIN. To me, 0 makes the most
> sense for monitoring relfrozenxid.
As far as I know, relfrozenxid is only a permanent XID for relkinds
that don't have storage; then it's zero.  So I think you should just
change your query to ignore pg_class rows where relfrozenxid = 0, and
leave xid_age() alone.
-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Robert Haas | 2015-10-22 21:29:51 | Re: Making tab-complete.c easier to maintain | 
| Previous Message | Robert Haas | 2015-10-22 21:16:40 | Re: COPY FREEZE and PD_ALL_VISIBLE |