On 08/05/18 18:11, Ildar Musin wrote:
On 08.05.2018 17:15, Peter Eisentraut wrote:
On 5/8/18 09:19, Chapman Flack wrote:
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
Andrew Gierth wrote:
> > "Andreas" == Andreas Karlsson writes:
>
> Andreas> It would be a pain if the SQL committee started using MAP for
> Andreas> something.
>
> They already did - MAP is a non-reserved keyword in sql2016, used at
> least with . Can't see any obvious
> conflict with use
On 08.05.2018 17:15, Peter Eisentraut wrote:
On 5/8/18 09:19, Chapman Flack wrote:
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?
Peter Eisentraut writes:
> On 5/8/18 10:18, Alvaro Herrera wrote:
>> How would you invoke it? It seems you'd be forced to use EXECUTE in a
>> plpgsql function, or a C function.
> Yes, I was thinking about a C function.
The thing actually implementing MAP would presumably be in C,
so this doesn'
On 5/8/18 10:18, Alvaro Herrera wrote:
> Peter Eisentraut wrote:
>> On 5/8/18 09:19, Chapman Flack wrote:
>>> 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
> "Andreas" == Andreas Karlsson writes:
Andreas> It would be a pain if the SQL committee started using MAP for
Andreas> something.
They already did - MAP is a non-reserved keyword in sql2016, used at
least with . Can't see any obvious
conflict with use in expressions, but I haven't checked
On 05/08/2018 02:49 PM, Ildar Musin wrote:
The main point of this patch was about convenience; the performance
thing came out later just as a side effect :) Many users are familiar
with "map/reduce/filter" concept that many languages (not only
functional ones) utilized. And my though was that it
Peter Eisentraut wrote:
> On 5/8/18 09:19, Chapman Flack wrote:
> > 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?
>
On 5/8/18 09:19, Chapman Flack wrote:
> 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?
Yeah, you can pass a function to another
On 05/08/2018 09:19 AM, Chapman Flack wrote:
>
> 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 pro
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,
On 08.05.2018 15:49, Ildar Musin wrote:
select map (pow(x, 2) - 1 for x in array[1,2,3]);
Sorry, the example should be:
select map (pow(2, x) - 1 for x in array[1,2,3,4,5]);
?column?
---
{1,3,7,15,31}
(1 row)
--
Ildar Musin
i.mu...@postgrespro.ru
Hello Tom, Ashutosh,
On 07.05.2018 18:16, Tom Lane wrote:
Ashutosh Bapat writes:
Is there a way we can improve unnest() and array_agg() to match
the performance you have specified by let's say optimizing the
cases specially when those two are used together. Identifying that
may be some work, b
Ashutosh Bapat writes:
> Is there a way we can improve unnest() and array_agg() to match the
> performance you have specified by let's say optimizing the cases
> specially when those two are used together. Identifying that may be
> some work, but will not require introducing new syntax.
+1. The
On Fri, May 4, 2018 at 6:38 PM, Ildar Musin wrote:
> Hello hackers,
>
> Recently I was working with sql arrays in postgres and it turned out
> that postgres doesn't have such very convinient functional constructions
> as map, reduce and filter. Currently to map function over array user has
> to ma
Hello hackers,
Recently I was working with sql arrays in postgres and it turned out
that postgres doesn't have such very convinient functional constructions
as map, reduce and filter. Currently to map function over array user has
to make a subquery like:
select u.* from
my_table,
16 matches
Mail list logo