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

Re: Proposal: plpgsql - "for in array" statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: plpgsql - "for in array" statement
Date: 2010-09-29 04:27:33
Message-ID: AANLkTikV_avOiHNnsHtEv87ze-QDURuNXScA4eiM-Gex@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
2010/9/28 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> 2010/9/28 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>>> Sure it can: it could be a parenthesized top-level query.  In fact,
>>> that's what plpgsql will assume if you feed it that syntax today.
>
>> no - there are not any legal construct FOR r IN (..)
>
> You are simply wrong, sir, and I suggest that you go read the SQL
> standard until you realize that.  Consider for example
>
>        for r in (SELECT ... FROM a UNION SELECT ... FROM b) INTERSECT (SELECT ... FROM c) LOOP ...
>
> The parentheses here are not merely legal, they are *necessary*, else
> the semantics of the UNION/INTERSECT operations change.
>

ok, then probably one variant is for-in-array array_expr. Is there agreement?

Regards

Pavel Stehule




>                        regards, tom lane
>

In response to

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2010-09-29 04:27:50
Subject: Re: I: About "Our CLUSTER implementation is pessimal" patch
Previous:From: Josh KupershmidtDate: 2010-09-29 03:53:33
Subject: Re: I: About "Our CLUSTER implementation is pessimal" patch

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