Re: final patch - plpgsql: for-in-array

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: final patch - plpgsql: for-in-array
Date: 2010-11-18 17:55:44
Message-ID: AANLkTin+2UwjvqOEifYFdD=NEANyS1fN2g4jYi43yedU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/11/18 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Andrew Dunstan <andrew(at)dunslane(dot)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 quite difficult
> to separate.  Adding another one makes that worse, with the consequences
> that we might misinterpret the user's intent, leading either to
> misleading/unhelpful error messages or unexpected runtime behavior.
> If you consult the archives you can find numerous past instances of
> complaints from people who hit such problems with the existing set of
> FOR sub-syntaxes, so this isn't hypothetical.
>

yes, this argument is correct - but we can rearange a parser rules
related to FOR statement. It can be solved.

> I'm also quite afraid of having a conflict with other future extensions
> of FOR, which we might want to introduce either on our own hook or for
> compatibility with something Oracle might add to PL/SQL in future.

we talked about it last time - and I respect it - syntax is FOR IN
>>>ARRAY<<< expression

>
> This might not be the worst place in the entire system to be introducing
> inessential syntactic sugar, but it's certainly one of the top ten.
> I would *much* rather we get the performance benefit by internal
> optimization, and forego inventing syntax.
>

Regards

Pavel

>                        regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2010-11-18 18:01:45 Re: Indent authentication overloading
Previous Message Robert Haas 2010-11-18 17:54:14 Re: final patch - plpgsql: for-in-array