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 CEA8F52800 for ; Thu, 30 Jun 2005 05:02:09 -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 35225-03 for ; Thu, 30 Jun 2005 08:02:00 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id 69AAC5280C for ; Thu, 30 Jun 2005 05:01:55 -0300 (ADT) Received: (qmail-ldap/ctrl 81414 invoked from network); 30 Jun 2005 08:01:55 -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 ; 30 Jun 2005 08:01:55 -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 j5U81uG29241 for ; Thu, 30 Jun 2005 10:01:56 +0200 (MEST) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id ; Thu, 30 Jun 2005 10:01:56 +0200 Message-ID: From: =?iso-8859-1?Q?K=D6PFERL_Robert?= To: Cc: pgsql-sql@postgresql.org Subject: Re: ENUM like data type Date: Thu, 30 Jun 2005 10:01:49 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/369 X-Sequence-Number: 21970 |> > 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(...). | |Indeed. A CHECK constraint on a DOMAIN is an ENUM plus some. Yea, that's what also I currently doing. But using varchars instead of symbolic values (as int4) is just more efficient. | |-- | | |---------------------------(end of |broadcast)--------------------------- |TIP 5: Have you checked our extensive FAQ? | | http://www.postgresql.org/docs/faq |