Re: pageinspect's infomask and infomask2 as smallint

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pageinspect's infomask and infomask2 as smallint
Date: 2011-02-25 22:19:05
Message-ID: 1298671760-sup-3726@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excerpts from Tom Lane's message of mar feb 15 12:42:00 -0300 2011:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:

> > 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?

Okay, so I changed the C code, and there's working upgrade support that
takes you from the 9.0 version to the 9.1 version.

I tested this by creating a 9.0 database with pageinspect loaded, then
pg_upgrade'd it to 9.1, then ran
create extension pageinspect from unpackaged;

If I run the function before running the CREATE EXTENSION command, it
works but still displays the negative numbers. After that, it behaves
as expected.

I was a bit surprised that I had to remove the ALTER EXTENSION/ADD
FUNCTION command from the upgrade script, but in hindsight it makes
perfect sense -- those commands are being run inside the
"create_extension" context and so the function being created already
belongs to the extension. Still, maybe we should make ALTER
EXTENSION/ADD idempotent.

I considered the idea of calling this version 1.1 and shipping a new
pageinspect--1.0--1.1.sql script (which works perfectly, provided you
run ALTER EXTENSION/DROP FUNCTION before dropping the function, then
ALTER/ADD later), but decided that this was overkill. We can still
change it if people thinks that'd be better, of course, but ...

Nice work on extensions and their upgradability, overall.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-02-25 22:25:26 Re: disposition of remaining patches
Previous Message Magnus Hagander 2011-02-25 22:00:24 Re: help: collation support on Windows