Re: ENUM like data type - Mailing list pgsql-sql

From KÖPFERL Robert
Subject Re: ENUM like data type
Date
Msg-id ED4E30DD9C43D5118DFB00508BBBA76EB167AF@neptun.sonorys.at
Whole thread Raw
In response to ENUM like data type  (MRB <nomail@example.com>)
Responses Re: ENUM like data type
List pgsql-sql
|
|I personally think that the ENUM data type is for databases
|that are not well
|designed. So, if you see the need for ENUM, that means you
|need to re-think
|your data design.
|

I disagree. In several relations (views of the world) one needs to have a
hand full of well defined values while
integers or bools are not appropriate and strings are too free form.
For example male female or true and false. Whilst the second has a well
known type, other things like a telephone number type don't have such type.
So a new one should be created instead of (varchar/ xy between 4 and 8). One
might argue that new 1:n relations with integrity shall be established but
this is in my eyes overkill for a constant number of values.
Also think of schema export without data. These values are part of the
schema data but not the schema itself which in this sense is wrong


|--
|select 'mmarques' || '@' || 'unl.edu.ar' AS email;
|---------------------------------------------------------
|Martín Marqués          |   Programador, DBA
|Centro de Telemática    |     Administrador
|               Universidad Nacional
|                    del Litoral
|---------------------------------------------------------
|
|---------------------------(end of
|broadcast)---------------------------
|TIP 4: Don't 'kill -9' the postmaster
|


pgsql-sql by date:

Previous
From: Zac
Date:
Subject: Re: ORDER records based on parameters in IN clause
Next
From: KÖPFERL Robert
Date:
Subject: Insert rule and default values for PK