Re: Distinct types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Subject: Re: Distinct types
Date: 2008-11-07 18:58:04
Message-ID: 21942.1226084284@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-07 19:11:40 Re: Block-level CRC checks
Previous Message Kenneth Marshall 2008-11-07 18:48:56 Re: [RRR] Tests citext casts - reviewed