Re: Proposal: associative arrays for plpgsql (concept)

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: Proposal: associative arrays for plpgsql (concept)
Дата
Msg-id 20050629202437.GB23647@fetter.org
обсуждение исходный текст
Ответ на Re: Proposal: associative arrays for plpgsql (concept)  (Douglas McNaught <doug@mcnaught.org>)
Список pgsql-hackers
On Wed, Jun 29, 2005 at 01:20:17PM -0400, Douglas McNaught wrote:
> David Fetter <david@fetter.org> writes:
> 
> > I'm all in favor of having associative arrays as a 1st-class data
> > type in PostgreSQL.  How much harder would it be to make these
> > generally available vs. tied to one particular language?
> 
> We already have them--they're called "tables with primary keys". :)
> 
> What's the use-case for these things?  Just imitating Oracle?

It would make named function parameters *very* easy to do. :)

SELECT *
FROM foo_func(   a => 2,   b => 5,   c => current_timestamp::timestamp with time zone
);

would be equivalent to

SELECT *
FROM foo_func(   c => current_timestamp::timestamp with time zone,   a => 2,   b => 5
);

and both would Do The Right Thing.  It also opens the door to default
parameters for those who want them.

Cheers,
D
-- 
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Open items
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: commit_delay, siblings