Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Jeff Davis wrote:
>> postgres=# create type mytype as int;

> 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

			regards, tom lane

In response to


pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group