Re: domain over enum problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: domain over enum problem
Date: 2011-01-11 18:05:04
Message-ID: 2971.1294769104@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2011-01-11 20:01:37 Re: BUG #5831: Splitting string into char array with string_to_array does not work
Previous Message Peter Eisentraut 2011-01-11 17:37:02 domain over enum problem