X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F105D52970 for ; Wed, 29 Jun 2005 09:40:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 46802-08 for ; Wed, 29 Jun 2005 12:40:09 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id 2BFA952968 for ; Wed, 29 Jun 2005 09:40:06 -0300 (ADT) Received: (qmail-ldap/ctrl 6150 invoked from network); 29 Jun 2005 12:40:07 -0000 Received: from unknown (HELO io.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 29 Jun 2005 12:40:07 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by io.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j5TCe9G22134 for ; Wed, 29 Jun 2005 14:40:09 +0200 (MEST) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id ; Wed, 29 Jun 2005 14:40:09 +0200 Message-ID: From: =?iso-8859-15?Q?K=D6PFERL_Robert?= To: Cc: pgsql-sql@postgresql.org Subject: Re: ENUM like data type Date: Wed, 29 Jun 2005 14:40:08 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/353 X-Sequence-Number: 21954 | |I personally think that the ENUM data type is for databases=20 |that are not well=20 |designed. So, if you see the need for ENUM, that means you=20 |need to re-think=20 |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 |--=20 |select 'mmarques' || '@' || 'unl.edu.ar' AS email; |--------------------------------------------------------- |Mart=EDn Marqu=E9s | Programador, DBA |Centro de Telem=E1tica | Administrador | Universidad Nacional | del Litoral |--------------------------------------------------------- | |---------------------------(end of=20 |broadcast)--------------------------- |TIP 4: Don't 'kill -9' the postmaster |