Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id A17671337B5C for ; Tue, 11 Jan 2011 14:05:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 64146-04 for ; Tue, 11 Jan 2011 18:05:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 5D30B133798E for ; Tue, 11 Jan 2011 14:05:07 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p0BI54d5002972; Tue, 11 Jan 2011 13:05:04 -0500 (EST) To: Peter Eisentraut cc: pgsql-bugs@postgresql.org Subject: Re: domain over enum problem In-reply-to: <1294767422.17361.3.camel@vanquo.pezone.net> References: <1294767422.17361.3.camel@vanquo.pezone.net> Comments: In-reply-to Peter Eisentraut message dated "Tue, 11 Jan 2011 19:37:02 +0200" Date: Tue, 11 Jan 2011 13:05:04 -0500 Message-ID: <2971.1294769104@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/84 X-Sequence-Number: 29106 Peter Eisentraut 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