Re: Distinct types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Distinct types
Date: 2008-11-28 16:49:17
Message-ID: 26955.1227890957@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> On Fri, 2008-11-28 at 11:20 -0500, Tom Lane wrote:
>> If it's going to take a significant amount of work then I think someone
>> ought to provide an actual justification why it's worth the work.

> Few thoughts:

> * Domains don't work very well in conjunction with arrays.

But distinct types would somehow work better?

> * Strong typing is preferable in complex applications to avoid errors
> like sum(ordinal_column). Most developers use this all the time in their
> 3GL code but cannot use it in SQL.

The problem I see with distinct types is that the typing is *too*
strong --- the datatype has in fact got no usable operations whatever.

> * Allows migration of code easier from places that use strange sounding
> datatypes that can be mapped easily to existing datatypes.

Again, distinct types do *not* provide a "mapping to existing types",
because none of the operations carry along. Domains would be more
nearly what you want for that.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-28 16:56:35 Re: Re: [COMMITTERS] pgsql: Add support for matching wildcard server certificates to the new
Previous Message Tom Lane 2008-11-28 16:44:36 Re: Review: Hot standby