Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-24 Thread Robert Haas
On Wed, Nov 24, 2010 at 1:06 AM, Tom Lane t...@sss.pgh.pa.us wrote: =?ISO-8859-1?Q?C=E9dric_Villemain?= cedric.villemain.deb...@gmail.com writes: I think you (Robert) misunderstood dramatically what Pavel try to do. Pavel did an excellent optimization work for a specific point. This specific

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-24 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Right, that was my impression, too. But, I think this may be partly a case of people talking past each other. My impression of this conversation was a repetition of this sequence: A: This syntax is bad. B: But it's way faster! ...which makes no

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-24 Thread Pavel Stehule
Hello 2010/11/24 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: Right, that was my impression, too.  But, I think this may be partly a case of people talking past each other.  My impression of this conversation was a repetition of this sequence: A: This syntax is

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-24 Thread Robert Haas
On Wed, Nov 24, 2010 at 10:33 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Right, that was my impression, too.  But, I think this may be partly a case of people talking past each other.  My impression of this conversation was a repetition of this sequence:

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-23 Thread Robert Haas
On Mon, Nov 22, 2010 at 11:55 PM, Pavel Stehule pavel.steh...@gmail.com wrote: ok, I can only recapitulate so this feature was proposed cca two months ago, and minimally Tom and maybe you did agreement - with request on syntax - do you remember? I am little bit tired so this agreement was

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-23 Thread Cédric Villemain
2010/11/23 Robert Haas robertmh...@gmail.com: On Mon, Nov 22, 2010 at 11:55 PM, Pavel Stehule pavel.steh...@gmail.com wrote: ok, I can only recapitulate so this feature was proposed cca two months ago, and minimally Tom and maybe you did agreement - with request on syntax - do you remember?

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-23 Thread Robert Haas
On Tue, Nov 23, 2010 at 8:56 PM, Cédric Villemain cedric.villemain.deb...@gmail.com wrote: 2010/11/23 Robert Haas robertmh...@gmail.com: On Mon, Nov 22, 2010 at 11:55 PM, Pavel Stehule pavel.steh...@gmail.com wrote: ok, I can only recapitulate so this feature was proposed cca two months ago,

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-23 Thread Tom Lane
=?ISO-8859-1?Q?C=E9dric_Villemain?= cedric.villemain.deb...@gmail.com writes: I think you (Robert) misunderstood dramatically what Pavel try to do. Pavel did an excellent optimization work for a specific point. This specific point looks crucial for me in the current behavior of PostgreSQL[1].

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-23 Thread Pavel Stehule
2010/11/24 Robert Haas robertmh...@gmail.com: On Tue, Nov 23, 2010 at 8:56 PM, Cédric Villemain cedric.villemain.deb...@gmail.com wrote: 2010/11/23 Robert Haas robertmh...@gmail.com: On Mon, Nov 22, 2010 at 11:55 PM, Pavel Stehule pavel.steh...@gmail.com wrote: ok, I can only recapitulate

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-23 Thread Pavel Stehule
sorry, there was a broken message 2010/11/24 Pavel Stehule pavel.steh...@gmail.com: 2010/11/24 Robert Haas robertmh...@gmail.com: On Tue, Nov 23, 2010 at 8:56 PM, Cédric Villemain cedric.villemain.deb...@gmail.com wrote: 2010/11/23 Robert Haas robertmh...@gmail.com: On Mon, Nov 22, 2010 at

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread Valentine Gogichashvili
Hi, with the FOR e IN SELECT UNNEST(a) construct there is an issue again related to the unresting of composite type arrays: BEGIN; CREATE TYPE truple AS (i integer, a text, b text); DO $SQL$ DECLARE start_time timestamp; t truple; ta truple[] := ARRAY( select ROW(s.i, 'A' || (s.i)::text,

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread Jaime Casanova
On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: On Thu, Sep 30, 2010 at 7:46 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello this patch implement a new iteration construct - iteration over an array. The sense of this new iteration is:  * a simple and

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread Robert Haas
On Mon, Nov 22, 2010 at 6:21 AM, Valentine Gogichashvili val...@gmail.com wrote: Hi, with the FOR e IN SELECT UNNEST(a) construct there is an issue again related to the unresting of composite type arrays: [ example ] Is it a bug or a feature? It looks like the problem in this example is that

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread Robert Haas
On Mon, Nov 22, 2010 at 8:39 AM, Jaime Casanova ja...@2ndquadrant.com wrote: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: On Thu, Sep 30, 2010 at 7:46 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello this patch implement a new iteration construct -

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread Pavel Stehule
Hello I spent last two days a searching how to solve this problem better. Probably I removed a issue with toasting. But I found other issue, that wasn't discussed before. This issue is only seq access to items via array_seek function. I though about some variable that stores a last accessed

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread Robert Haas
On Mon, Nov 22, 2010 at 3:36 PM, Pavel Stehule pavel.steh...@gmail.com wrote: So, please, I know, so you and Tom are busy, but try to spend a few time about this problem before you are definitely reject this idea. If I were to spend more time on this problem, what exactly would I spend that

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread Pavel Stehule
2010/11/22 Robert Haas robertmh...@gmail.com: On Mon, Nov 22, 2010 at 3:36 PM, Pavel Stehule pavel.steh...@gmail.com wrote: So, please, I know, so you and Tom are busy, but try to spend a few time about this problem before you are definitely reject this idea. If I were to spend more time on

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread David Fetter
On Tue, Nov 23, 2010 at 05:55:28AM +0100, Pavel Stehule wrote: ok, I can only recapitulate so this feature was proposed cca two months ago, and minimally Tom and maybe you did agreement - with request on syntax - do you remember? I am little bit tired so this agreement was changed when I

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-22 Thread Pavel Stehule
2010/11/23 David Fetter da...@fetter.org: On Tue, Nov 23, 2010 at 05:55:28AM +0100, Pavel Stehule wrote: ok, I can only recapitulate so this feature was proposed cca two months ago, and minimally Tom and maybe you did agreement - with request on syntax - do you remember? I am little bit tired

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-19 Thread Pavel Stehule
I checked my tests and the most important is a remove a repeated detoast. postgres=# CREATE OR REPLACE FUNCTION public.filter01(text[], text, integer) RETURNS text[] LANGUAGE plpgsql AS $function$ DECLARE s text[] := '{}'; l int := 0; i int; v text; loc text[] = $1; BEGIN FOR i IN

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Cédric Villemain
2010/11/18 Pavel Stehule pavel.steh...@gmail.com: 2010/11/18 Tom Lane t...@sss.pgh.pa.us: Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: i will start the review of this one... but before that sorry for suggesting this a

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Cédric Villemain cedric.villemain.deb...@gmail.com: 2010/11/18 Pavel Stehule pavel.steh...@gmail.com: 2010/11/18 Tom Lane t...@sss.pgh.pa.us: Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: i will start the

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Merlin Moncure
On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: i will start the review of this one... but before that sorry for suggesting this a bit later but about

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Cédric Villemain
2010/11/18 Pavel Stehule pavel.steh...@gmail.com: 2010/11/18 Cédric Villemain cedric.villemain.deb...@gmail.com: 2010/11/18 Pavel Stehule pavel.steh...@gmail.com: 2010/11/18 Tom Lane t...@sss.pgh.pa.us: Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Robert Haas
On Thu, Nov 18, 2010 at 10:24 AM, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: i will start the review of

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Cédric Villemain
2010/11/18 Robert Haas robertmh...@gmail.com: On Thu, Nov 18, 2010 at 10:24 AM, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Robert Haas robertmh...@gmail.com: On Thu, Nov 18, 2010 at 10:24 AM, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Cédric Villemain cedric.villemain.deb...@gmail.com: 2010/11/18 Robert Haas robertmh...@gmail.com: On Thu, Nov 18, 2010 at 10:24 AM, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes:

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Andrew Dunstan
On 11/18/2010 10:33 AM, Robert Haas wrote: On Thu, Nov 18, 2010 at 10:24 AM, Merlin Moncuremmonc...@gmail.com wrote: Pavel's performance argument is imnsho valid. arrays at present are the best way to pass data around functions and any optimizations here are very welcome. Given that, is

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Cédric Villemain
2010/11/18 Pavel Stehule pavel.steh...@gmail.com: 2010/11/18 Cédric Villemain cedric.villemain.deb...@gmail.com: 2010/11/18 Robert Haas robertmh...@gmail.com: On Thu, Nov 18, 2010 at 10:24 AM, Merlin Moncure mmonc...@gmail.com wrote: On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Tom Lane
Merlin Moncure mmonc...@gmail.com writes: On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yes, which begs the question of why bother at all. Pavel's performance argument is imnsho valid. Well, that argument is unsupported by any evidence, so far as I've seen. More to the

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Merlin Moncure mmonc...@gmail.com writes: On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yes, which begs the question of why bother at all. Pavel's performance argument is imnsho valid. Well, that argument is unsupported by any

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: 2010/11/18 Tom Lane t...@sss.pgh.pa.us: More to the point, if there is indeed an interesting performance win here, we could get the same win by internally optimizing the existing syntax. sorry, but I don't agree. I don't think, so there are some

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: Syntactic sugar is not entirely to be despised, anyway. If it were harmless syntactic sugar I wouldn't be objecting so loudly. The problem here is that FOR is a syntactic choke point: it's already overloaded with several different sub-syntaxes that are

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: 2010/11/18 Tom Lane t...@sss.pgh.pa.us: More to the point, if there is indeed an interesting performance win here, we could get the same win by internally optimizing the existing syntax. sorry, but I don't

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Robert Haas
On Thu, Nov 18, 2010 at 12:36 PM, Tom Lane t...@sss.pgh.pa.us wrote: I would *much* rather we get the performance benefit by internal optimization, and forego inventing syntax. +1. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Andrew Dunstan and...@dunslane.net writes: Syntactic sugar is not entirely to be despised, anyway. If it were harmless syntactic sugar I wouldn't be objecting so loudly. The problem here is that FOR is a syntactic choke point: it's already overloaded

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Robert Haas robertmh...@gmail.com: On Thu, Nov 18, 2010 at 12:36 PM, Tom Lane t...@sss.pgh.pa.us wrote: I would *much* rather we get the performance benefit by internal optimization, and forego inventing syntax. +1. any optimization will be about 10-20% slower than direct access.

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Robert Haas
On Thu, Nov 18, 2010 at 1:03 PM, Pavel Stehule pavel.steh...@gmail.com wrote: 2010/11/18 Robert Haas robertmh...@gmail.com: On Thu, Nov 18, 2010 at 12:36 PM, Tom Lane t...@sss.pgh.pa.us wrote: I would *much* rather we get the performance benefit by internal optimization, and forego inventing

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Robert Haas robertmh...@gmail.com: On Thu, Nov 18, 2010 at 1:03 PM, Pavel Stehule pavel.steh...@gmail.com wrote: 2010/11/18 Robert Haas robertmh...@gmail.com: On Thu, Nov 18, 2010 at 12:36 PM, Tom Lane t...@sss.pgh.pa.us wrote: I would *much* rather we get the performance benefit

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: what is a slow: a) repeated detoasting - access with subscripts - maybe detoasted values can be cached? b) evaluation of SRF expression - maybe call of SRF function can be simple expression, c) faster evaluation ro query The most important is

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: 2010/11/18 Tom Lane t...@sss.pgh.pa.us: The problem here is that FOR is a syntactic choke point: it's already overloaded with several different sub-syntaxes that are quite difficult to separate.  Adding another one makes that worse, with the

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: what is a slow: a) repeated detoasting - access with subscripts - maybe detoasted values can be cached? b) evaluation of SRF expression - maybe call of SRF function can be simple expression, c) faster

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: this note was a different -only a few people use FOR IN SELECT UNNEST for iteration over array. So from Robert's question (what is important for current code?) perspective the more significant is access to individual fields via subscripts. For

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: unnest returns all fields, but these fields should not be used. There isn't possible to say - stop, I don't need other fields. It's possible just with special PL statement, because it is controlled by PL. So it is reason why I don't believe in

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Andrew Dunstan
On 11/18/2010 02:17 PM, Pavel Stehule wrote: -only a few people use FOR IN SELECT UNNEST for iteration over array. How on earth do you know that? I use it a lot and I was just demonstrating it to a client yesterday, and I'm quite sure he will use it a lot too. I bet I'm far from alone.

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: 2010/11/18 Tom Lane t...@sss.pgh.pa.us: The problem here is that FOR is a syntactic choke point: it's already overloaded with several different sub-syntaxes that are quite difficult to separate.  Adding

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: this note was a different -only  a few people use FOR IN SELECT UNNEST for iteration over array. So from Robert's question (what is important for current code?) perspective the more significant is access to

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Andrew Dunstan and...@dunslane.net: On 11/18/2010 02:17 PM, Pavel Stehule wrote:  -only a few people use FOR IN SELECT UNNEST for iteration over array. How on earth do you know that? I use it a lot and I was just demonstrating it to a client yesterday, and I'm quite sure he will

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Andrew Dunstan
On 11/18/2010 02:39 PM, Pavel Stehule wrote: 2010/11/18 Andrew Dunstanand...@dunslane.net: On 11/18/2010 02:17 PM, Pavel Stehule wrote: -only a few people use FOR IN SELECT UNNEST for iteration over array. How on earth do you know that? I use it a lot and I was just demonstrating it to a

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: unnest returns all fields, but these fields should not be used. There isn't possible to say - stop, I don't need other fields. It's possible just with special PL statement, because it is controlled by PL. So

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Andrew Dunstan and...@dunslane.net: On 11/18/2010 02:39 PM, Pavel Stehule wrote: 2010/11/18 Andrew Dunstanand...@dunslane.net: On 11/18/2010 02:17 PM, Pavel Stehule wrote:  -only a few people use FOR IN SELECT UNNEST for iteration over array. How on earth do you know that? I

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of jue nov 18 17:00:04 -0300 2010: 2010/11/18 Andrew Dunstan and...@dunslane.net: I didn't say so nobody use it. You, me, David. But I really didn't see this pattern here in real applications. Lots of people are told to use it on IRC. Trust me,

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of jue nov 18 17:00:04 -0300 2010: 2010/11/18 Andrew Dunstan and...@dunslane.net: I didn't say so nobody use it. You, me, David. But I really didn't see this pattern here in real applications.

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: 2010/11/18 Alvaro Herrera alvhe...@commandprompt.com: I fail to see how this supports the FOR-IN-array development though.  It will just be another unused construct for most people, no? maybe I don't understand well, but patch FOR-IN-ARRAY has a

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Andres Freund
On Thursday 18 November 2010 21:11:32 Alvaro Herrera wrote: Excerpts from Pavel Stehule's message of jue nov 18 17:00:04 -0300 2010: 2010/11/18 Andrew Dunstan and...@dunslane.net: I didn't say so nobody use it. You, me, David. But I really didn't see this pattern here in real

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Andrew Dunstan
On 11/18/2010 06:06 PM, Andres Freund wrote: Well, a good reason for that might be that unnest() is pretty new... Most code I read has been initially written quite a bit earlier. Seeing 8.4 in production is only starting to get common. I guess we must have more adventurous customers than you

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Cédric Villemain
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: what is a slow: a) repeated detoasting - access with subscripts - maybe detoasted values can be cached? b) evaluation of SRF expression - maybe call of SRF function can be simple expression, c) faster

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-18 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: 2010/11/18 Alvaro Herrera alvhe...@commandprompt.com: I fail to see how this supports the FOR-IN-array development though.  It will just be another unused construct for most people, no? maybe I don't

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-17 Thread Jaime Casanova
On Thu, Sep 30, 2010 at 7:46 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello this patch implement a new iteration construct - iteration over an array. The sense of this new iteration is:  * a simple and cleaner syntax i will start the review of this one... but before that sorry for

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-17 Thread Merlin Moncure
On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: On Thu, Sep 30, 2010 at 7:46 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello this patch implement a new iteration construct - iteration over an array. The sense of this new iteration is:  * a simple and

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-17 Thread Tom Lane
Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: i will start the review of this one... but before that sorry for suggesting this a bit later but about using UNNEST as part of the sintax? Does for-in-array do what unnset

Re: [HACKERS] final patch - plpgsql: for-in-array

2010-11-17 Thread Pavel Stehule
2010/11/18 Tom Lane t...@sss.pgh.pa.us: Merlin Moncure mmonc...@gmail.com writes: On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova ja...@2ndquadrant.com wrote: i will start the review of this one... but before that sorry for suggesting this a bit later but about using UNNEST as part of the

[HACKERS] final patch - plpgsql: for-in-array

2010-09-30 Thread Pavel Stehule
Hello this patch implement a new iteration construct - iteration over an array. The sense of this new iteration is: * a simple and cleaner syntax * a faster execution - this bring down a number of detoast operations create or replace function subscripts(anyarray, int) returns int[] as $$