Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZJll1-0005NQ-Dy for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Jul 2015 17:00:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZJll0-0002Ev-Qf for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Jul 2015 17:00:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJlkP-0001XG-0l for pgsql-bugs@postgresql.org; Mon, 27 Jul 2015 16:59:29 +0000 Received: from jiboia.ensmp.fr ([194.214.158.137]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZJlkH-00023n-Hf for pgsql-bugs@postgresql.org; Mon, 27 Jul 2015 16:59:27 +0000 Received: from cri.ensmp.fr (21.168.138.88.rev.sfr.net [88.138.168.21]) (authenticated bits=0) by jiboia.ensmp.fr (8.15.1/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id t6RGx7QN017500 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 Jul 2015 18:59:08 +0200 Date: Mon, 27 Jul 2015 18:59:06 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@sto To: Jeff Janes cc: Heikki Linnakangas , Tom Lane , bz@mailinator.com, PostgreSQL Bugs List Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text In-Reply-To: Message-ID: References: <20150614155912.2732.93270@wrigleys.postgresql.org> <42501.1434389175@sss.pgh.pa.us> <598.1434425712@sss.pgh.pa.us> <55AE06AB.4090002@iki.fi> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at jiboia.ensmp.fr with ID 55B6635B.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 55B6635B.000 from 21.168.138.88.rev.sfr.net/21.168.138.88.rev.sfr.net/88.138.168.21/cri.ensmp.fr/ X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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