Skip site navigation (1) Skip section navigation (2)

Re: strange evaluation Window function and SRF functions?

From: David Johnston <polobo(at)yahoo(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: strange evaluation Window function and SRF functions?
Date: 2012-07-30 16:37:18
Message-ID: EDEC968F-78D5-43ED-8E35-0B9DC08B61B9@yahoo.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Jul 30, 2012, at 12:33, Thom Brown <thom(at)linux(dot)com> wrote:

> On 30 July 2012 17:19, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> Hello
> 
> I seen nice trick based on window function http://stackoverflow.com/questions/11700930/how-can-i-trim-a-text-array-in-postgresql
> 
> but isn't it example of wrong evaluation? Result of row_number is not correct
> 
> Looks right to me.  I guess the way to get the row_number they're after out of the result set would involve changing OVER () to OVER (ORDER BY unnest(myTextArrayColumn))
> 

The better way would be to perform the unnest in a sub-select then attach the row number in the outer select.

David J.

In response to

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2012-07-30 16:47:45
Subject: Re: strange evaluation Window function and SRF functions?
Previous:From: Thom BrownDate: 2012-07-30 16:33:33
Subject: Re: strange evaluation Window function and SRF functions?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group