Re: pl/pgsql: END verbosity

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pl/pgsql: END verbosity
Date: 2005-06-22 05:29:44
Message-ID: 42B8F748.8060408@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> The long-term point in my mind is that removing syntactical
> redundancy always reduces the ability to detect errors or report
> errors acccurately

Lexical scoping is unambiguous in a language like PL/PgSQL. Since it is
simple to determine whether a given END matches an IF, LOOP, or BEGIN, I
don't see how it would reduce our "ability to detect errors or report
errors accurately".

> Consider for example the possibility that Oracle's next release adds
> some new frammish that can't be duplicated because we chose not to
> distinguish various forms of "END xxx" ...

As lexical scoping is still unambiguous, we could actually add a K_LOOP
/ K_IF token to the input stream, if that would make you happier :) (Of
course I'm not suggesting this -- the point is that as far as the parser
is concerned, we should have precisely the same information for
disambiguating the input as we used to have.)

BTW, I notice that Oracle actually allows:

<<label>>
LOOP
-- ...
END LOOP label;

whereas we don't allow the optional label following END LOOP. Which goes
to my general point: this frammish has existed in PL/SQL for a while,
but it's not as if people are clamoring for us to implement it. I would
wager that most people care about having *equivalent* features to
PL/SQL, not exactly identical syntax. For example, the lack of
autonomous transactions is something people have asked for in the past,
because it *does* make porting PL/SQL applications more difficult. I
can't see anyone losing any sleep because we are slightly more relaxed
about the input we accept.

-Neil

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2005-06-22 05:31:41 Re: Schedule for 8.1 feature freeze
Previous Message Neil Conway 2005-06-22 05:12:49 Re: pl/pgsql: END verbosity

Browse pgsql-patches by date

  From Date Subject
Next Message Eugen Nedelcu 2005-06-22 08:54:40 Re: thousands comma numeric formatting in psql
Previous Message Neil Conway 2005-06-22 05:12:49 Re: pl/pgsql: END verbosity