Re: enums

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, ted(at)php(dot)net, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: enums
Date: 2005-10-28 20:12:01
Message-ID: 43628611.2020906@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jim C. Nasby wrote:

>>>>
>>>>
>>>But why force a re-write of the entire table just to change the name of
>>>something?
>>>
>>>
>>>
>>>
>>Because you are not just changing the name of something.
>>
>>
>
>No, I was refering specifically to the case of wanting to rename
>something. IE: you setup an enum for sky colors (blue, black), and then
>the PHB issues an edict that the daytime sky is now green. In this case
>you (or at least I) don't want to define a new enum, I just want to
>change 'blue' to 'green' in that enum. There's no reason it needs to hit
>the table at all.
>
>

Well, with enumkit you can't, because the values are hardwired in the
.so file. With a builtin facility you would be able to, because the
values would live in the catalog. However, hacking the catalog is not
something I would encourage - what you are suggesting basically breaks
the abstraction. But sure, it would be possible. I would not provide an
SQL level facility to do it, though. My approved way to do it would be
like the example I gave earlier.

cheers

andrew

In response to

  • Re: enums at 2005-10-28 18:23:27 from Jim C. Nasby

Responses

  • Re: enums at 2005-10-28 20:23:26 from Jim C. Nasby

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-10-28 20:17:58 Re: TRAP: FailedAssertion("!((itemid)->lp_flags & 0x01)",
Previous Message Tom Lane 2005-10-28 19:04:02 Re: TRAP: FailedAssertion("!((itemid)->lp_flags & 0x01)",