Re: Domains versus polymorphic functions, redux - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Domains versus polymorphic functions, redux
Date
Msg-id BANLkTin6K0frABj3=+pA6iABU5S9aR07MQ@mail.gmail.com
Whole thread Raw
In response to Re: Domains versus polymorphic functions, redux  (Noah Misch <noah@leadboat.com>)
Responses Re: Domains versus polymorphic functions, redux
Re: Domains versus polymorphic functions, redux
List pgsql-hackers
On Fri, Jun 3, 2011 at 1:14 AM, Noah Misch <noah@leadboat.com> wrote:
> No, there's no need to do that.  The domain "is" an array, not merely something
> that can be coerced to an array.  Therefore, it can be chosen as the polymorphic
> type directly.  Indeed, all released versions do this.

Well, as Bill Clinton once said, "it depends on what the meaning of
the word 'is' is".  I think of array types in PostgreSQL as meaning
"the types whose monikers end in a pair of square brackets".  We don't
in general have the ability to create a type that behaves "like"
another type.  In particular, you can't create a user-defined type
that "is" an array in the same way that a domain-over-array "is" an
array.  If we had some kind of type interface facility that might be
possible, but we don't.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Alexey Klyukin
Date:
Subject: Re: Estimating total amount of shared memory required by postmaster
Next
From: Jim Nasby
Date:
Subject: Re: Identifying no-op length coercions