pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@2ndQuadrant.com>
To: Stuart Bishop <stuart@stuartbishop.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7661: pgstattuple from unpackaged fails on old installation
Date: Thu, 15 Nov 2012 17:17:40 +0800
Message-ID: <50A4B334.9010209@2ndQuadrant.com> (raw)
In-Reply-To: <CADmi=6NHD9o-FxQfA7QtB=qK18DdrooTWwgp1kMS0y4SxxYMkg@mail.gmail.com>
References: <E1TYsn3-00007l-CR@wrigleys.postgresql.org>
	<50A48ED6.1070102@2ndQuadrant.com>
	<CADmi=6NHD9o-FxQfA7QtB=qK18DdrooTWwgp1kMS0y4SxxYMkg@mail.gmail.com>

On 11/15/2012 03:32 PM, Stuart Bishop wrote:
>> That's a known issue with several of the extensions. You need to upgrade
>> the contrib module install to the current version, *then* wrap the
>> unpackaged contrib module into an extension with "FROM UNPACKAGED".
> Yeah, just thought I'd stick it in the... umm... bugtracker, as so far
> 'FROM unpackaged' has failed in 66% of up updates. Is the real
> solution is for the foo--unpackaged--1.0.sql script to recreate
> missing objects before adding them to the extension?
For simple extensions running the create script should do the job, yes.
It's not so clear cut for extensions that define data types, though.

If I recall correctly the general advice for those has been to:

- Create the new versions of extensions in the DB you're going to
restore to; then
- restore your database to that DB with the extensions pre-created in it.

I'm surprised not to find any documentation on coping with this issue in:

  http://www.postgresql.org/docs/current/static/contrib.html
<http://www.postgresql.org/docs/9.2/static/contrib.html;
or
  http://www.postgresql.org/docs/current/static/extend-extensions.html
<http://www.postgresql.org/docs/9.2/static/extend-extensions.html;

(though it's possible it's there and I missed it).

There used to be brief mention in contrib.html before the extensions
changes went in, saying:

"After a major-version upgrade of PostgreSQL, run the installation
script again, even though the module's objects might have been brought
forward from the old installation by dump and restore. This ensures that
any new functions will be available and any needed corrections will be
applied."

... but I'm not certain that advice is sufficient for all contrib modules.

Extensions were created because upgrading DBs that used contrib modules
was a painful mess.


-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

view thread (5+ messages)  latest in thread

Message-ID: <50A4B334.9010209@2ndQuadrant.com>
Permalink:  ../50A4B334.9010209@2ndQuadrant.com/
Also on:    postgresql.org/message-id/50A4B334.9010209@2ndQuadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: craig@2ndQuadrant.com, stuart@stuartbishop.net
  Subject: Re: BUG #7661: pgstattuple from unpackaged fails on old installation
  In-Reply-To: <50A4B334.9010209@2ndQuadrant.com>
  References: <E1TYsn3-00007l-CR@wrigleys.postgresql.org> <50A48ED6.1070102@2ndQuadrant.com> <CADmi=6NHD9o-FxQfA7QtB=qK18DdrooTWwgp1kMS0y4SxxYMkg@mail.gmail.com> <50A4B334.9010209@2ndQuadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox