Re: RfD: more powerful "any" types

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: RfD: more powerful "any" types
Дата
Msg-id 603c8f070909091646l6820aa30haca7ad4f2caffa11@mail.gmail.com
обсуждение исходный текст
Ответ на Re: RfD: more powerful "any" types  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: RfD: more powerful "any" types  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список 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 по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Ragged CSV import
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Ragged CSV import