Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYva3-0004zo-LI for pgsql-bugs@postgresql.org; Thu, 15 Nov 2012 09:17:51 +0000 Received: from outmail149056.authsmtp.com ([62.13.149.56]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYva2-0008T2-0R for pgsql-bugs@postgresql.org; Thu, 15 Nov 2012 09:17:51 +0000 Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt10.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id qAF9HmDA008393; Thu, 15 Nov 2012 09:17:48 GMT Received: from ayaki.localdomain (124-148-90-153.dyn.iinet.net.au [124.148.90.153]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id qAF9HfYE047854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Nov 2012 09:17:44 GMT Message-ID: <50A4B334.9010209@2ndQuadrant.com> Date: Thu, 15 Nov 2012 17:17:40 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Stuart Bishop CC: pgsql-bugs@postgresql.org Subject: Re: BUG #7661: pgstattuple from unpackaged fails on old installation References: <50A48ED6.1070102@2ndQuadrant.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------020701060009070501090301" X-Server-Quench: 5109f912-2f05-11e2-95c0-002264978518 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFaQBbY1ZH HGQLWlZEUFR7WGR/ bw8fbAdZfEtKVxtj UFZIR1FNFgBqBAMA SF9vJBAKIWwzeHp3 bUNmEHFTWEd/O0N8 QkcCHGwEeGU2aGUC UUENdR5ddVBKYx9F aFJ5UHoKaWAGbjQC El17DBoMEg5qYA5o bUlGcgxMGBRDBjEn WxkeASg3GUBNST80 KlQ7LEYVF0UYPUg+ eVUoWFYDexgUQgpa EwlMBjRFLl0FTjYq CgUy X-Authentic-SMTP: 61633235383639.1014:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.148.90.153/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201211/77 X-Sequence-Number: 34635 This is a multi-part message in MIME format. --------------020701060009070501090301 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 or http://www.postgresql.org/docs/current/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 --------------020701060009070501090301 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by punt10.authsmtp.com id qAF9HmDA008393
On 11/15/2012 03:32 PM, Stuart Bishop wrote:
That's a known issue with several of the extension=
s. 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:

=C2=A0 ht= tp://www.postgresql.org/docs/current/static/contrib.html
or
=C2=A0 http://www.postgresql.org/docs/current/static/extend-extensions.ht= ml

(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.


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