Re: RfD: more powerful "any" types - Mailing list pgsql-hackers

From Robert Haas
Subject Re: RfD: more powerful "any" types
Date
Msg-id 603c8f070909091646l6820aa30haca7ad4f2caffa11@mail.gmail.com
Whole thread Raw
In response to Re: RfD: more powerful "any" types  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: RfD: more powerful "any" types
List pgsql-hackers
On Wed, Sep 9, 2009 at 3:23 PM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> What we need is a system where base types are represented
>> by an OID, but derived types (list and functional types) are built up
>> using type constructors that take other types as arguments.
>
> This is SQL, not Haskell.  What you suggest seems about two orders of
> magnitude more complex than real-world applications could justify.
>
> (so where is pl/haskell, anyway?)

There are languages much less obscure than Haskell that support
passing functions as arguments to other functions, such as C.   While
C doesn't support user-defined type constructors, it does support one
built-in type constructor - you can declare a function argument as
taking arbitrary argument types and returning an arbitrary type.  C++
supports user-defined type constructors via the template mechanism.

The scripting languages generally do not guarantee type-safety for
functions passed as arguments, but they do let you pass them.
However, I can't really imagine how we could get away with such a
system in SQL, due to security concerns.

...Robert


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Ragged CSV import
Next
From: Robert Haas
Date:
Subject: Re: Ragged CSV import