Re: ENUM type

From: Alexey Borzov <borz_off(at)cs(dot)msu(dot)su>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>, PostgreSQL advocacy <pgsql-advocacy(at)postgresql(dot)org>
Subject: Re: ENUM type
Date: 2005-07-27 13:07:03
Message-ID: 42E786F7.4010304@cs.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general

Hi,

Jim C. Nasby wrote:
> Please go back through the original thread. The original comment was
> regarding adding an enum type that actually made sense; ie: it stored an
> int in the base table that referenced a parent table. The original
> poster was arguing that enum didn't really buy anything over doing that
> the manual method (create seperate table; fill that table with values;
> create base table with RI, and finally, make sure that everything that
> touches the base table can do mapping, or add a bunch of other stuff to
> do the mapping automatically). My argument is that simply specifying
>
> fieldname ENUM(...)
>
> is a heck of a lot easier on developers than doing all those manual
> steps, yet it still does things in the correct, normalized manner
> (unlike MySQL).

I don't want to go through the original thread, but you are probably missing a
point, MySQL manual states [1]:
==========
If you want to determine all possible values for an ENUM column, use SHOW
COLUMNS FROM tbl_name LIKE enum_col and parse the ENUM definition in the second
column of the output.
==========

Are you actually going to also implement SHOW COLUMNS blah-blah-blah? If not,
poor MySQL users will still need to rewrite their applications. They will also
need to know the name of the automagically generated table from somewhere.

[1] http://dev.mysql.com/doc/mysql/en/enum.html

In response to

Browse pgsql-advocacy by date

  From Date Subject
Next Message Alexey Borzov 2005-07-27 13:08:40 Re: [HACKERS] Enticing interns to PostgreSQL
Previous Message Merlin Moncure 2005-07-27 12:45:53 Re: ENUM type

Browse pgsql-general by date

  From Date Subject
Next Message Audrey Bergeron-Morin 2005-07-27 13:24:35 Re: duplicate messages?
Previous Message Jeff Trout 2005-07-27 13:04:42 Re: Postgresql with max_connections=4096