Re: ENUM like data type

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: Martín Marqués <martin(at)bugs(dot)unl(dot)edu(dot)ar>, pgsql-sql(at)postgresql(dot)org
Subject: Re: ENUM like data type
Date: 2005-06-29 21:20:32
Message-ID: 200506292320.32726.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-06-29 22:55:59 Re: ENUM like data type
Previous Message Scott Marlowe 2005-06-29 15:07:18 Re: ORDER records based on parameters in IN clause