Re: [HACKERS] Enums again

2005-11-08 Thread Christopher Kings-Lynne
Maybe I missed it, but I didn't see any conclusion. If I want to design an Open Source system now that may be in beta in three to six months and I'd like to use enums, is this a good place to look? There's no way you're going to be using enums. I guess I'm wondering about the kit going into

Re: [HACKERS] Enums again

2005-11-08 Thread Kaare Rasmussen
Just don't use enums - they're awful. In general? So, instead of using enums for order states or originating system, I'll user numbers or text? Or implement lookup tables ? ---(end of broadcast)--- TIP 1: if posting/reading through Usenet,

Re: [HACKERS] Enums again

2005-11-08 Thread Christopher Kings-Lynne
So, instead of using enums for order states or originating system, I'll user numbers or text? Or implement lookup tables ? Use a text field and a CHECK constraint if you have just a couple of states, and a lookup table if you have many. Always use a lookup table if you plan on adding new

Re: [HACKERS] Enums again

2005-11-08 Thread Andrew Dunstan
Christopher Kings-Lynne wrote: Maybe I missed it, but I didn't see any conclusion. If I want to design an Open Source system now that may be in beta in three to six months and I'd like to use enums, is this a good place to look? There's no way you're going to be using enums. I guess I'm

Re: [HACKERS] Enums again

2005-11-08 Thread Alvaro Herrera
Andrew Dunstan wrote: In the catalog, pg_type would get a new column of type text[] that would hold the list of values, and typtype would have a new possible value of 'e' for enumeration. There might be other consequential changes too, but I think that would be most of it. Huh, why not

Re: [HACKERS] Enums again

2005-11-08 Thread Andrew Dunstan
Alvaro Herrera wrote: Andrew Dunstan wrote: In the catalog, pg_type would get a new column of type text[] that would hold the list of values, and typtype would have a new possible value of 'e' for enumeration. There might be other consequential changes too, but I think that would be

Re: [HACKERS] Enums again

2005-11-08 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Alvaro Herrera wrote: Huh, why not have the actual values in a separate catalog like pg_enumvalues or some such? Sure, could do that. I don't have strong feelings either way. I'd vote for the separate catalog instead of bloating pg_type.

Re: [HACKERS] Enums again

2005-11-08 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: Alvaro Herrera wrote: Huh, why not have the actual values in a separate catalog like pg_enumvalues or some such? Sure, could do that. I don't have strong feelings either way. I'd vote for the separate

Re: [HACKERS] Enums again

2005-11-08 Thread Christopher Kings-Lynne
Also, Christopher - I was somewhat motivated to work on this by your recent comment about enums being the number one demand of migrating MySQL users, so I am mildly amused by your last sentence ;-) They're not mutually exclusive statements :) ---(end of

[HACKERS] Enums again

2005-11-07 Thread Kaare Rasmussen
I've been going through the thread that Andrew Dunstan started with his enumkit. Maybe I missed it, but I didn't see any conclusion. If I want to design an Open Source system now that may be in beta in three to six months and I'd like to use enums, is this a good place to look? I guess I'm