Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgOEl-0008Jx-LH for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Jul 2018 05:45:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fgOEk-0000Qf-0h for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Jul 2018 05:45:54 +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.89) (envelope-from ) id 1fgNw6-0007pk-3i for pgsql-bugs@lists.postgresql.org; Fri, 20 Jul 2018 05:26:38 +0000 Received: from sonic302-19.consmr.mail.sg3.yahoo.com ([106.10.242.139]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgNw2-0000AC-4N for pgsql-bugs@lists.postgresql.org; Fri, 20 Jul 2018 05:26:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1532064390; bh=JWLBZCsNwOfavrdgGeKYwJLJQbZzMP3ZDtOP5m6kvTc=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=TEfEztF5VsULQC739x+i2+zgbS296v0lFasXf3swykaeq/gIpPDHTZx4AEYAY0VpzHpCU5YC2Vgfx90R2jqmuLC5QonyciP5l2H5PZyGdUsgEH76xgsr161fnrs/us1FsNA8reUT7Nvg0ULmCMccPspgf25o1aqjaG5GsRXyljYEvG9xQRmYQohQyrLIJMIgjoQBRg2W+fqJ0xjI0A5NutXnFVZ73J+ZK4PWERGfRJfQRc2zVk5S2JcyjNOpYEdg6y7PSvJTEiGy4Azk/oKdwnjT78m6qIPJXTp+ssJW9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onic302.consmr.mail.sg3.yahoo.com with HTTP; Fri, 20 Jul 2018 05:26:30 +0000 Date: Fri, 20 Jul 2018 05:26:26 +0000 (UTC) From: Nivruth Nandigam Reply-To: "nivruth_n@yahoo.com" To: "andrew@tao11.riddles.org.uk" , "pgsql-bugs@lists.postgresql.org" Message-ID: <478548952.6699751.1532064386799@mail.yahoo.com> In-Reply-To: <878t66jxr3.fsf@news-spur.riddles.org.uk> References: <153206236870.1405.3502568417414309750@wrigleys.postgresql.org> <878t66jxr3.fsf@news-spur.riddles.org.uk> Subject: Re: BUG #15286: BEFORE or AFTER not working while adding values for existing enums MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6699750_599775154.1532064386796" X-Mailer: WebService/1.1.12062 YahooMailAndroidMobile YMobile/1.0 (com.yahoo.mobile.client.android.mail/5.29.3; Android/8.1.0; OPM4.171019.021.P1; sailfish; Google; Pixel; 4.73; 1794x1080;) Content-Length: 4101 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_6699750_599775154.1532064386796 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Right clicking on the source and then checking the values. Executing this q= uery also gives me the values in order but shouldn't the enum also reflect = the order when right clicked and checked? Also, when I try to set this as a db column I see the wrong order in the dr= op down, the added values appear last in the drop down menu of the enum col= umn.=C2=A0 Sent from Yahoo Mail on Android=20 =20 On Thu, Jul 19, 2018 at 10:15 PM, Andrew Gierth wrote: >>>>> "PG" =3D=3D PG Bug reporting form writes: PG> I'm trying to modify an existing enum and use the BEFORE or AFTER PG> feature to add a value in between the existing values but I'm PG> noticing that the values are only being added to the enum in the PG> end. How are you looking at the order of values? I get this: create type e1 as enum ('foo','bar','baz'); alter type e1 add value 'quux' after 'foo'; postgres=3D# select * from unnest(enum_range(null::e1)) order by 1; unnest=20 -------- foo quux bar baz (4 rows) which is the expected order. --=20 Andrew (irc:RhodiumToad) =20 ------=_Part_6699750_599775154.1532064386796 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Right clicking on the source and then checking the values. Executing this q= uery also gives me the values in order but shouldn't the enum also reflect = the order when right clicked and checked?

Also, when I try to set this as a db column I see the wrong order in= the drop down, the added values appear last in the drop down menu of the e= num column. 

Sent from Yahoo Mail on Android

<= blockquote style=3D"margin: 0 0 20px 0;">
On Thu, Jul 19, 2018 at 10:15 PM, Andrew= Gierth
<andrew@tao11.riddles.org.uk> wrote:
<= div style=3D"padding: 10px 0 0 20px; margin: 10px 0 0 0; border-left: 1px s= olid #6D00F6;">
>>>>> "PG" =3D=3D PG Bug re= porting form <noreply@postgresql.org> writes:
<= div dir=3D"ltr">
PG> I'm trying to modify an = existing enum and use the BEFORE or AFTER
PG>= feature to add a value in between the existing values but I'm
PG> noticing that the values are only being added to the = enum in the
PG> end.

How are you looking at the order of values?

I get this:

create type e1 as enum ('foo','bar= ','baz');
alter type e1 add value 'quux' after 'f= oo';

postgres=3D# sele= ct * from unnest(enum_range(null::e1)) order by 1;
unnest
--------
fo= o
quux
bar
<= div dir=3D"ltr"> baz
(4 rows)

which is the expected order.
<= div dir=3D"ltr">
--
An= drew (irc:RhodiumToad)
------=_Part_6699750_599775154.1532064386796--