pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martín Marqués <martin@bugs.unl.edu.ar>
To: pgsql-sql@postgresql.org
Subject: Re: ENUM like data type
Date: Wed, 29 Jun 2005 10:21:10 -0300
Message-ID: <200506291021.10986.martin@bugs.unl.edu.ar> (raw)
In-Reply-To: <ED4E30DD9C43D5118DFB00508BBBA76EB167AF@neptun.sonorys.at>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB167AF@neptun.sonorys.at>

El Mié 29 Jun 2005 09:40, KÖPFERL Robert escribió:
> 
> |
> |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

Please, most of this can be done with CHECK(...).

-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
---------------------------------------------------------
Martín Marqués          |   Programador, DBA
Centro de Telemática	|     Administrador
               Universidad Nacional
                    del Litoral
---------------------------------------------------------



view thread (16+ messages)  latest in thread

Message-ID: <200506291021.10986.martin@bugs.unl.edu.ar>
Permalink:  ../200506291021.10986.martin@bugs.unl.edu.ar/
Also on:    postgresql.org/message-id/200506291021.10986.martin@bugs.unl.edu.ar

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: martin@bugs.unl.edu.ar
  Subject: Re: ENUM like data type
  In-Reply-To: <200506291021.10986.martin@bugs.unl.edu.ar>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox