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 1CFD5528B7 for ; Wed, 29 Jun 2005 18:20:44 -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 52939-02 for ; Wed, 29 Jun 2005 21:20:35 +0000 (GMT) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 61DDB5281B for ; Wed, 29 Jun 2005 18:20:33 -0300 (ADT) Received: (qmail invoked by alias); 29 Jun 2005 21:20:34 -0000 Received: from dsl-082-083-253-130.arcor-ip.net (EHLO colt.pezone.net) [82.83.253.130] by mail.gmx.net (mp024) with SMTP; 29 Jun 2005 23:20:34 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: Rod Taylor Subject: Re: ENUM like data type Date: Wed, 29 Jun 2005 23:20:32 +0200 User-Agent: KMail/1.8.1 Cc: =?iso-8859-1?q?Mart=EDn_Marqu=E9s?= , pgsql-sql@postgresql.org References: <200506291021.10986.martin@bugs.unl.edu.ar> <1120051729.39304.113.camel@home> In-Reply-To: <1120051729.39304.113.camel@home> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506292320.32726.peter_e@gmx.net> X-Y-GMX-Trusted: 0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.013 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/361 X-Sequence-Number: 21962 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. -- Peter Eisentraut http://developer.postgresql.org/~petere/