pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: bz@mailinator.com
Cc: PostgreSQL Bugs List <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text
Date: Mon, 27 Jul 2015 18:59:06 +0200 (CEST)
Message-ID: <alpine.DEB.2.10.1507271848230.3538@sto> (raw)
In-Reply-To: <CAMkU=1xirYuVX1OAmoTqXuj_aZvcYKzKvfFOPoMQPh=cvZgUdA@mail.gmail.com>
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>
	<CAMkU=1xirYuVX1OAmoTqXuj_aZvcYKzKvfFOPoMQPh=cvZgUdA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>


Hello,

>> After some tests, it seems that an upgrade script cannot be provided,
>> or I missed something.
>>
>> Basically version 1.0 was confusing ISBN & ISBN13, and for upgrading the
>> ISBN type definition must be modified. However, there is no such thing as
>> ALTER TYPE, and trying DROP TYPE/ALTER TYPE is rejected because the type
>> belongs to an extension (hey I know that, this is what is being done!).
>
> You can't test extension upgrade scripts by running the component 
> statements at the command line. You have to make an actual dummy upgrade 
> script and test it via "alter extension ... update ...".

Yep... but I actually tried that.

> When executed in that context, they are exempted from the rule you are 
> running into.

With DROP TYPE isbn:

  # ALTER EXTENSION isn UPDATE;
  ERROR:  cannot drop type isbn because other objects depend on it
  DETAIL:  extension isn depends on type isbn
  HINT:  Use DROP ... CASCADE to drop the dependent objects too.

With DROP TYPE isbn CASCADE:

  # ALTER EXTENSION isn UPDATE;
  ERROR:  cannot drop extension "isn" because it is being modified

> (Or maybe there is another way that I don't know of).
> But I wonder what will happen when you try to drop a type which is in use?

Probably it should drop the dependent objects recursively, but as isn 
depends on isbn we do not want to drop the extension while upgrading it.

-- 
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.1507271848230.3538@sto>
Permalink:  ../alpine.DEB.2.10.1507271848230.3538@sto/
Also on:    postgresql.org/message-id/alpine.DEB.2.10.1507271848230.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, jeff.janes@gmail.com, hlinnaka@iki.fi, tgl@sss.pgh.pa.us, bz@mailinator.com
  Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text
  In-Reply-To: <alpine.DEB.2.10.1507271848230.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> <CAMkU=1xirYuVX1OAmoTqXuj_aZvcYKzKvfFOPoMQPh=cvZgUdA@mail.gmail.com> <alpine.DEB.2.10.1507271848230.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