pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: bz@mailinator.com, PostgreSQL Bugs List <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text
Date: Mon, 27 Jul 2015 23:04:33 +0200 (CEST)
Message-ID: <alpine.DEB.2.10.1507272252090.3538@sto> (raw)
In-Reply-To: <20150727180450.GI5596@postgresql.org>
References: <20150614155912.2732.93270@wrigleys.postgresql.org>
	<42501.1434389175@sss.pgh.pa.us>
	<alpine.DEB.2.10.1506152026520.26470@sto>
	<598.1434425712@sss.pgh.pa.us>
	<alpine.DEB.2.10.1506160728030.26470@sto>
	<alpine.DEB.2.10.1506200900060.31742@sto>
	<55AE06AB.4090002@iki.fi>
	<alpine.DEB.2.10.1507271115030.3538@sto>
	<20150727180450.GI5596@postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>


> If I understand this correctly, you need to ALTER EXTENSION .. DROP
> (which removes the type from the extension), then drop the type, create
> it fresh, then ALTER EXTENSION ADD to put it back.

After some testing with that, I have a conundrum: I would like the update 
to *fail* if the user actually uses the isbn type so as not to harm data.

However, when the script is at:

   DROP TYPE isbn;

It fails, because the isbn_in & out functions depends on it.
If you try:

   DROP FUNCTION isbn_in(cstring);

It fails, because the isbn type depends on it. Sure.

The usual exit strategy is:

   DROP TYPE isbn CASCADE;

Which works fine... but as a side effect silently remove ISBN columns that 
may exist in user table. I do not think it is a good idea for an extension 
update script to do that to a librarian:-)

Bar any idea around this issue, I think that an extension upgrade script 
is really unadvisable, and the user should do a dump data, drop extension, 
create extension, restore data.

-- 
Fabien.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (26+ messages)  latest in thread

Message-ID: <alpine.DEB.2.10.1507272252090.3538@sto>
Permalink:  ../alpine.DEB.2.10.1507272252090.3538@sto/
Also on:    postgresql.org/message-id/alpine.DEB.2.10.1507272252090.3538@sto

 · 

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: coelho@cri.ensmp.fr, alvherre@2ndquadrant.com, hlinnaka@iki.fi, tgl@sss.pgh.pa.us
  Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text
  In-Reply-To: <alpine.DEB.2.10.1507272252090.3538@sto>
  References: <20150614155912.2732.93270@wrigleys.postgresql.org> <42501.1434389175@sss.pgh.pa.us> <alpine.DEB.2.10.1506152026520.26470@sto> <598.1434425712@sss.pgh.pa.us> <alpine.DEB.2.10.1506160728030.26470@sto> <alpine.DEB.2.10.1506200900060.31742@sto> <55AE06AB.4090002@iki.fi> <alpine.DEB.2.10.1507271115030.3538@sto> <20150727180450.GI5596@postgresql.org> <alpine.DEB.2.10.1507272252090.3538@sto>

* 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