Re: MAP syntax for arrays - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: MAP syntax for arrays
Date
Msg-id 4cc3a217-20a7-5a77-2085-099ca04a6e3f@anastigmatix.net
Whole thread Raw
In response to Re: MAP syntax for arrays  (Ildar Musin <i.musin@postgrespro.ru>)
Responses Re: MAP syntax for arrays  (Chapman Flack <chap@anastigmatix.net>)
Re: MAP syntax for arrays  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On 05/08/2018 08:57 AM, Ildar Musin wrote:
> 
> select map (pow(2, x) - 1 for x in array[1,2,3,4,5]);

I wonder how efficient an implementation would be possible strictly
as a function, without grammar changes?

While PostgreSQL certainly has extensions to and divergences from
standard SQL syntax, some historical and some recent, it seems like
there ought to be a highish bar for adding new ones; or, looking at it
another way, has this feature been proposed to the SQL committee?
It doesn't sound like a bad idea, and supporting new syntax for it
would be an easier call it if it were known to be in an SQL draft
somewhere.

-Chap


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Parallel Append implementation
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Clock with Adaptive Replacement