Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZJpaW-0006yh-S8 for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Jul 2015 21:05:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZJpaW-00013E-Dr for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Jul 2015 21:05:32 +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 1ZJpZt-0000HW-TI for pgsql-bugs@postgresql.org; Mon, 27 Jul 2015 21:04:54 +0000 Received: from boipeva.ensmp.fr ([194.214.158.136]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZJpZq-0006xs-EK for pgsql-bugs@postgresql.org; Mon, 27 Jul 2015 21:04:52 +0000 Received: from cri.ensmp.fr (21.168.138.88.rev.sfr.net [88.138.168.21]) (authenticated bits=0) by boipeva.ensmp.fr (8.15.1/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id t6RL4YvH021439 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 Jul 2015 23:04:35 +0200 Date: Mon, 27 Jul 2015 23:04:33 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@sto To: Alvaro Herrera 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: <20150727180450.GI5596@postgresql.org> 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> <20150727180450.GI5596@postgresql.org> 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 boipeva.ensmp.fr with ID 55B69CE2.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: 55B69CE2.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 > 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