pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Rod Taylor <pg@rbt.ca>
Cc: Martín Marqués <martin@bugs.unl.edu.ar>
Cc: pgsql-sql@postgresql.org
Subject: Re: ENUM like data type
Date: Wed, 29 Jun 2005 23:20:32 +0200
Message-ID: <200506292320.32726.peter_e@gmx.net> (raw)
In-Reply-To: <1120051729.39304.113.camel@home>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB167AF@neptun.sonorys.at>
	<200506291021.10986.martin@bugs.unl.edu.ar>
	<1120051729.39304.113.camel@home>

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/



view thread (16+ messages)  latest in thread

Message-ID: <200506292320.32726.peter_e@gmx.net>
Permalink:  ../200506292320.32726.peter_e@gmx.net/
Also on:    postgresql.org/message-id/200506292320.32726.peter_e@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: peter_e@gmx.net, pg@rbt.ca, martin@bugs.unl.edu.ar
  Subject: Re: ENUM like data type
  In-Reply-To: <200506292320.32726.peter_e@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox