Re: enum bug

From: Elein <elein(at)varlena(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: GENERAL <pgsql-general(at)postgresql(dot)org>
Subject: Re: enum bug
Date: 2016-03-14 18:00:27
Message-ID: 8BB502CC-6B85-4150-B7DC-9D5B2AE79530@varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Elein Mustain
elein(at)varlena(dot)com
510-637-9106

> On Mar 13, 2016, at 7:22 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>
> Elein wrote:
>
> Hi Elein,
>
>> * When an insert into an enum column fails give the person a hint as to valid values
>
>> -- Lousy message. Show enum list.
>> insert into badinfo values ('green');
>> ERROR: invalid input value for enum rainbow: "green"
>> LINE 1: insert into badinfo values ('green');
>
> True, we could improve that, though it could easily get messy with large
> enums.
>
>
>>> * Make enum_range to not be dependent on values in the target table.
>>> Remove/Obsolete enum_range( enum_column ) and replace with enum_range( typein regtype )
>>>
>>> Workaround: define the enum_range( typein regtyp ) yourself.
>
> Hmm, this is pretty clunky. I don't think passing the OID of the enum
> itself is a lot better, but if you use a regtype cast then perhaps it's
> not that bad. Perhaps we could have both functions.

I was thinking of this function in terms of the catalog functions like pg_get_functiondef which takes an oid. Obviosly all of those functions can take reg type with the actual name.
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Millman 2016-03-14 18:03:35 Re: Unexpected result using floor() function
Previous Message Shulgin, Oleksandr 2016-03-14 17:54:11 Re: how to switch old replication Master to new Standby after promoting old Standby