Re: pageinspect's infomask and infomask2 as smallint

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pageinspect's infomask and infomask2 as smallint
Date: 2011-02-15 15:45:41
Message-ID: AANLkTi=+Yykx1Kj59vkoNF+XOonyCP=2bySr37UFi7jp@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 15, 2011 at 10:42 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>> On 14.02.2011 21:49, Alvaro Herrera wrote:
>>> Thanks to Noah Misch's review of the keylock patch I noticed that
>>> pageinspect's heap_page_items(bytea) function returns infomask and
>>> infomask2 as smallint (signed).  But the fields in the tuple header are
>>> 16 bits unsigned, so if the high (16th) bit is set, it returns negative
>>> values which seem hard to handle.  Not a problem for infomask, because
>>> the high bit is used for a VACUUM FULL-era flag; but in infomask2 it is
>>> used.
>>>
>>> This seems hard to fix for existing installations with the unpackaged
>>> module already loaded -- IIRC it's not acceptable to drop a function,
>>> which is what would need to be done here.
>
>> pageinspect is just a debugging aid, so I think we should change it from
>> smallint to int4 in 9.1, and not bother backporting.
>
> I don't see any reason that the old version of the function couldn't be
> dropped in the upgrade script.  It's not likely anything would be
> depending on it, is it?

I don't see much point in taking the risk.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-02-15 15:50:19 Re: sepgsql contrib module
Previous Message Robert Haas 2011-02-15 15:45:04 Re: Add support for logging the current role