pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: domain over enum problem
Date: Tue, 11 Jan 2011 13:05:04 -0500
Message-ID: <2971.1294769104@sss.pgh.pa.us> (raw)
In-Reply-To: <1294767422.17361.3.camel@vanquo.pezone.net>
References: <1294767422.17361.3.camel@vanquo.pezone.net>

Peter Eisentraut <peter_e@gmx.net> writes:
> CREATE TYPE zzz_enum AS ENUM ('A', 'B', 'C');
> CREATE TABLE zzz_test1 (z zzz_enum);
> SELECT * FROM zzz_test1 WHERE z = 'A';

> That works.  But:

> CREATE DOMAIN zzz AS zzz_enum DEFAULT 'A';
> CREATE TABLE zzz_test2 (z zzz);
> SELECT * FROM zzz_test2 WHERE z = 'A';
> ERROR:  42883: operator does not exist: zzz = unknown

I suppose this is because enforce_generic_type_consistency doesn't smash
domains to base types before checking type_is_enum.  I'm a bit hesitant
to change that though.  We don't smash to base types before checking if
a domain matches an anyarray, and I seem to recall that that's
intentional.

			regards, tom lane



view thread (2+ messages)

Message-ID: <2971.1294769104@sss.pgh.pa.us>
Permalink:  ../2971.1294769104@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2971.1294769104@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net
  Subject: Re: domain over enum problem
  In-Reply-To: <2971.1294769104@sss.pgh.pa.us>
  References: <1294767422.17361.3.camel@vanquo.pezone.net> <2971.1294769104@sss.pgh.pa.us>

* 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