Re: Distinct types
| От | Tom Lane |
|---|---|
| Тема | Re: Distinct types |
| Дата | |
| Msg-id | 26955.1227890957@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Distinct types (Simon Riggs <simon@2ndQuadrant.com>) |
| Ответы |
Re: Distinct types
|
| Список | pgsql-hackers |
Simon Riggs <simon@2ndQuadrant.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
В списке pgsql-hackers по дате отправления: