Re: Distinct types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Distinct types
Date
Msg-id 21942.1226084284@sss.pgh.pa.us
Whole thread Raw
In response to Re: Distinct types  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Distinct types  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Jeff Davis wrote:
>> postgres=# create type mytype as int;
>> CREATE DOMAIN

> Is that really the return message we want?

That's an artifact of the fact that the patch tries to piggyback on
the DOMAIN infrastructure instead of implementing its own statement
type etc.

The overly close relationship between domains and distinct types seems
to also explain the fact that CREATE INDEX fails to fail.  It looks like
getBaseType() will happily smash a distinct type to its base, and Peter
has put defenses to prevent that into some but not all call sites of
getBaseType.  I'm not sure why he did that rather than having the check
inside getBaseType itself; if there's a principled explanation for
having some of them behave differently, it sure isn't given in the
patch.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Kenneth Marshall
Date:
Subject: Re: [RRR] Tests citext casts - reviewed
Next
From: Alvaro Herrera
Date:
Subject: Re: Block-level CRC checks