pgsql: Instead of trying (and failing) to allow <<label>> at the end of

Started by Nonamealmost 16 years ago7 messages
#1Noname
tgl@postgresql.org

Log Message:
-----------
Instead of trying (and failing) to allow <<label>> at the end of a DECLARE
section, throw an error message saying explicitly that the label must go
before DECLARE. Per investigation of a recent pgsql-novice question,
this code did not work as intended in any modern PG version, maybe not ever.
Allowing such a thing would only create ambiguity anyway, so it seems better
to remove it than fix it.

Modified Files:
--------------
pgsql/src/pl/plpgsql/src:
gram.y (r1.141 -> r1.142)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/gram.y?r1=1.141&amp;r2=1.142)

#2Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Noname (#1)
Re: pgsql: Instead of trying (and failing) to allow <<label>> at the end of

On Tue, Mar 2, 2010 at 8:53 PM, Tom Lane <tgl@postgresql.org> wrote:

Log Message:
-----------
Instead of trying (and failing) to allow <<label>> at the end of a DECLARE
section, throw an error message saying explicitly that the label must go
before DECLARE.

with the docs saying another thing, this couldn't be considered as a
bug fix and therefore backpatchable

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

#3David Fetter
david@fetter.org
In reply to: Jaime Casanova (#2)
Re: [COMMITTERS] pgsql: Instead of trying (and failing) to allow <<label>> at the end of

On Tue, Mar 02, 2010 at 11:02:54PM -0500, Jaime Casanova wrote:

On Tue, Mar 2, 2010 at 8:53 PM, Tom Lane <tgl@postgresql.org> wrote:

Log Message:
-----------
Instead of trying (and failing) to allow <<label>> at the end of a DECLARE
section, throw an error message saying explicitly that the label must go
before DECLARE.

with the docs saying another thing, this couldn't be considered as a
bug fix and therefore backpatchable

+1 for back-patching.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Fetter (#3)
Re: Re: [COMMITTERS] pgsql: Instead of trying (and failing) to allow <<label>> at the end of

David Fetter <david@fetter.org> writes:

On Tue, Mar 02, 2010 at 11:02:54PM -0500, Jaime Casanova wrote:

On Tue, Mar 2, 2010 at 8:53 PM, Tom Lane <tgl@postgresql.org> wrote:

Instead of trying (and failing) to allow <<label>> at the end of a DECLARE
section, throw an error message saying explicitly that the label must go
before DECLARE.

with the docs saying another thing, this couldn't be considered as a
bug fix and therefore backpatchable

+1 for back-patching.

No, I intentionally didn't back-patch that. The only benefit of the
change is throwing a useful error message for questionable syntax.
As against that we have the possibility of breaking code that works
now, if someone's got an incorrectly-placed label that they're not
actually referencing. I grant that that's not a very likely case;
but the error that the message would help people fix isn't very
likely either, as demonstrated by the fact that this never came up
before. We shouldn't be making changes in the behavior of back
branches for such things.

regards, tom lane

#5Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Tom Lane (#4)
Re: Re: [COMMITTERS] pgsql: Instead of trying (and failing) to allow <<label>> at the end of

On Wed, Mar 3, 2010 at 1:00 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

David Fetter <david@fetter.org> writes:

On Tue, Mar 02, 2010 at 11:02:54PM -0500, Jaime Casanova wrote:

On Tue, Mar 2, 2010 at 8:53 PM, Tom Lane <tgl@postgresql.org> wrote:

Instead of trying (and failing) to allow <<label>> at the end of a DECLARE
section, throw an error message saying explicitly that the label must go
before DECLARE.

with the docs saying another thing, this couldn't be considered as a
bug fix and therefore backpatchable

+1 for back-patching.

No, I intentionally didn't back-patch that.  The only benefit of the
change is throwing a useful error message for questionable syntax.

then, maybe a fix in the docs of back branches? OTOH, anyone that
already had the docs downloaded will not benefit of that, but that is
just as fair as if you don't update the server you don't get the last
fixes ;)

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jaime Casanova (#5)
Re: Re: [COMMITTERS] pgsql: Instead of trying (and failing) to allow <<label>> at the end of

Jaime Casanova <jcasanov@systemguards.com.ec> writes:

On Wed, Mar 3, 2010 at 1:00 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

No, I intentionally didn't back-patch that.  The only benefit of the
change is throwing a useful error message for questionable syntax.

then, maybe a fix in the docs of back branches?

What's to fix? The documentation already makes it quite clear where
you're supposed to put the label. I think documenting the code's
actual behavior could only confuse people.

regards, tom lane

#7Jaime Casanova
jcasanov@systemguards.com.ec
In reply to: Tom Lane (#6)
Re: Re: [COMMITTERS] pgsql: Instead of trying (and failing) to allow <<label>> at the end of

On Wed, Mar 3, 2010 at 1:12 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Jaime Casanova <jcasanov@systemguards.com.ec> writes:

On Wed, Mar 3, 2010 at 1:00 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

No, I intentionally didn't back-patch that.  The only benefit of the
change is throwing a useful error message for questionable syntax.

then, maybe a fix in the docs of back branches?

What's to fix?  The documentation already makes it quite clear where
you're supposed to put the label.  I think documenting the code's
actual behavior could only confuse people.

ah! yeah! sorry for the noise... it was just the need to say something
else... ;)

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157