Re: final patch - plpgsql: for-in-array - Mailing list pgsql-hackers

From Tom Lane
Subject Re: final patch - plpgsql: for-in-array
Date
Msg-id 5570.1290107794@sss.pgh.pa.us
Whole thread Raw
In response to Re: final patch - plpgsql: for-in-array  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: final patch - plpgsql: for-in-array
Re: final patch - plpgsql: for-in-array
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2010/11/18 Tom Lane <tgl@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 consequences
>> that we might misinterpret the user's intent, leading either to
>> misleading/unhelpful error messages or unexpected runtime behavior.

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

No, it can't.  The more things that can possibly follow FOR, the less
likely that you correctly guess which one the user had in mind when
faced with something that's not quite syntactically correct.  Or maybe
it *is* syntactically correct, only not according to the variant that
the user thought he was invoking.  We've seen bug reports of this sort
connected with FOR already; in fact I'm pretty sure you've responded to
a few yourself.  Adding more variants *will* make it worse.  We need
a decent return on investment for anything we add here, and this
proposal just doesn't offer enough benefit.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: describe objects, as in pg_depend
Next
From: Pavel Stehule
Date:
Subject: Re: final patch - plpgsql: for-in-array