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 AF48F52952 for ; Wed, 29 Jun 2005 19:56:12 -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 89464-05 for ; Wed, 29 Jun 2005 22:56:02 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2DDE8528B9 for ; Wed, 29 Jun 2005 19:56:02 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j5TMtxIm029906; Wed, 29 Jun 2005 18:55:59 -0400 (EDT) To: Peter Eisentraut Cc: Rod Taylor , =?iso-8859-1?q?Mart=EDn_Marqu=E9s?= , pgsql-sql@postgresql.org Subject: Re: ENUM like data type In-reply-to: <200506292320.32726.peter_e@gmx.net> References: <200506291021.10986.martin@bugs.unl.edu.ar> <1120051729.39304.113.camel@home> <200506292320.32726.peter_e@gmx.net> Comments: In-reply-to Peter Eisentraut message dated "Wed, 29 Jun 2005 23:20:32 +0200" Date: Wed, 29 Jun 2005 18:55:59 -0400 Message-ID: <29905.1120085759@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/362 X-Sequence-Number: 21963 Peter Eisentraut writes: > Rod Taylor wrote: >> Indeed. A CHECK constraint on a DOMAIN is an ENUM plus some. > Not really. A domain doesn't create a new type. If you base your enum > domains on the text type, as would usually be the case, then nothing > stops you from using, say, text concatenation operators and the like. > I suppose in practice this won't matter too much, but it can't be > called a clean design. What you'd really need is a way to create a > distinct type. SQL has a feature for that, but PostgreSQL hasn't > implemented it. It's not that hard to make your own type using the builtin textin and textout functions, and then add just the functions you wish to provide. regards, tom lane