Re: pl/pgsql: END verbosity

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: pl/pgsql: END verbosity
Дата
Msg-id 42B8F748.8060408@samurai.com
обсуждение исходный текст
Ответ на Re: pl/pgsql: END verbosity  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pl/pgsql: END verbosity  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-hackers
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: pl/pgsql: END verbosity
Следующее
От: Neil Conway
Дата:
Сообщение: Re: Schedule for 8.1 feature freeze