age(xid) function bug

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема age(xid) function bug
Дата
Msg-id 200808200314.m7K3E2I00516@momjian.us
обсуждение исходный текст
Ответы Re: age(xid) function bug
Список pgsql-hackers
I see we recommend using the age(xid) function to check for XID
wraparound:
http://www.postgresql.org/docs/8.3/static/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND

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:
test=> \df age                                        List of functions   Schema   | Name | Result data type |
        Argument data
types------------+------+------------------+----------------------------------------------------------...pg_catalog |
age | integer          | xid
 

For example:
test=> select txid_current(); txid_current--------------          397(1 row)test=> select age('10000'::xid);
age--------9602(1 row)
 

Seems this is a bug.  I think the fix is to do the arithmetic in int8
and return an int8.

--  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 по дате отправления:

Предыдущее
От: Joshua Drake
Дата:
Сообщение: Re: A smaller default postgresql.conf
Следующее
От: Tom Lane
Дата:
Сообщение: Re: age(xid) function bug