Re: pg_upgrade libraries check

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade libraries check
Date: 2012-05-29 20:10:41
Message-ID: 18643.1338322241@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> On Tue, May 29, 2012 at 02:38:03PM -0400, Tom Lane wrote:
>> Well, it'd eliminate the kluges for plpython, as well as possibly fixing
>> Andrew's JSON backport issue, and going forward there are going to be
>> more things like that. So I think it's something to pursue, but it's
>> not going to be a simple change unfortunately.

> I am confused how they fix the plpython issue (mapping plpython.so to
> plpython2.so). Is there an extension for these languages or is it just
> pg_pltemplate? Which extensions have config files?

Hmmm ... that is a good point; right now, there are probably still an
awful lot of installations that have PL languages installed "bare"
rather than wrapped in an extension, including all the ones where the
plpython library has the old name. So a fix that only considers
extensions doesn't get you out of the plpython problem.

(Eventually I would like to see "CREATE LANGUAGE foo" with no parameters
redefined as doing "CREATE EXTENSION foo", and doing away with
pg_pltemplate; but it didn't get done for 9.2.)

Actually, though, I don't see why pg_upgrade couldn't treat PL
languages, even bare ones, the same way I'm proposing for extensions.
Right now, it's already the case AFAICS that pg_dump --binary-upgrade
does not dump PL support functions for PLs listed in pg_pltemplate;
it just emits the CREATE LANGUAGE command and nothing else. This being
the case, it's simply wrong for pg_upgrade to be checking shlib names
for the old support functions, because that has got exactly nothing
to do with whether the CREATE LANGUAGE command will succeed in the new
installation. There are at least two ways you could check that
condition without assuming that the shlib name has stayed the same:

1. Look for an extension control file for the language name in the new
installation; if present, assume the proper shlib is installed too.

2. Look at the pg_pltemplate entries for the language in the new
database and see if they point to a shlib that exists.

I'd vote for #1 on the grounds that it's simpler and won't break when
we remove pg_pltemplate. It does assume that packagers of third-party
PLs have gotten off their duffs and extension-ified their languages.
I would think that would have been a pretty popular thing to do, though,
since it so greatly reduces the installation complexity for a language
not known to pg_pltemplate.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2012-05-29 20:20:50 Re: GiST buffering build, bug in levelStep calculation
Previous Message james 2012-05-29 19:46:14 Fake async rep target