Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajnT7-00028q-MK for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Mar 2016 12:37:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ajnT7-00071k-4f for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Mar 2016 12:37:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ajnT6-00070k-8W for pgsql-hackers@postgresql.org; Sat, 26 Mar 2016 12:37:28 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ajnT3-0004xu-F8 for pgsql-hackers@postgresql.org; Sat, 26 Mar 2016 12:37:27 +0000 Received: from mfilter20-d.gandi.net (mfilter20-d.gandi.net [217.70.178.148]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 66E14A80C7; Sat, 26 Mar 2016 13:37:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter20-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter20-d.gandi.net (mfilter20-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id jvizCORGbwgz; Sat, 26 Mar 2016 13:37:21 +0100 (CET) X-Originating-IP: 98.122.164.227 Received: from [192.168.10.146] (unknown [98.122.164.227]) (Authenticated sender: adsend@dunslane.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 635FAA80C4; Sat, 26 Mar 2016 13:37:20 +0100 (CET) Subject: Re: Alter or rename enum value To: "David G. Johnston" References: <56E049CC.8010201@dunslane.net> <25605.1457539654@sss.pgh.pa.us> <56E05635.70908@dunslane.net> <28167.1457543612@sss.pgh.pa.us> <56F49CF8.8050007@BlueTreble.com> <27476.1458876456@sss.pgh.pa.us> <56F58876.6020508@dunslane.net> Cc: Matthias Kurz , Tom Lane , Jim Nasby , "pgsql-hackers@postgresql.org" From: Andrew Dunstan Message-ID: <56F6827F.9040104@dunslane.net> Date: Sat, 26 Mar 2016 08:37:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 03/26/2016 12:35 AM, David G. Johnston wrote: > On Friday, March 25, 2016, Andrew Dunstan > wrote: > > > On 03/25/2016 04:13 AM, Matthias Kurz wrote: > > > Hopefully at the commitfest at least the transaction > limitation will/could be tackled - that would help us a lot > already. > > > I don't believe anyone knows how to do that safely. Enums pose > special problems here exactly because unlike all other types the > set of valid values is mutable. > > > Yeah, I'm not sure there is much blue sky here as long as the > definition of an enum is considered system data. It probably needs to > be altered so that a user can create a table of class enum with a > known layout that PostgreSQL can rely upon to perform optimizations > and provide useful behaviors - at least internally. The most visible > behavior being displaying the label while ordering using its position. > > The system, seeing a data type of that class, would have an implicit > reference between columns of that type and the source table. > You have to use normal cascade update/delete/do-nothing while > performing DML on the source table. > > In some ways it would be a specialized composite type, and we could > leverage that to you all the syntax available for those - but without > having a different function for each differently named enum classed > table since they all would share a common structure, differing only in > name. But the tables would be in user space and not a preordained > relation in pg_catalog. Maybe require they all inherit from some > template but empty table... > > We don't have the luxury of being able to redesign this as a green fields development. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers