Re: [Bug Fix] ECPG: could not use set xxx to default statement - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [Bug Fix] ECPG: could not use set xxx to default statement
Date
Msg-id 2883.1551031161@sss.pgh.pa.us
Whole thread Raw
In response to Re: [Bug Fix] ECPG: could not use set xxx to default statement  (Michael Meskes <meskes@postgresql.org>)
List pgsql-hackers
Michael Meskes <meskes@postgresql.org> writes:
>> Not seeing any motion on this, here's a draft patch to make these
>> scripts complain about missing semicolons.  Against the current
>> gram.y (which contains 2 such errors, as Michael noted) you
>> get output like

> Thanks Tom for looking into this. Are we agreed then that we want
> gram.y to have semicolons? 

Hearing no objections, I pushed it that way.

>> That's not *super* friendly, but it does give you the right line
>> number to look at in gram.y.  We could adjust the script (and the Makefile)
>> further so that the message would cite the gram.y filename, but I'm
>> not sure if it's worth the trouble.  Thoughts?

> IMO it's not worth it. We all know where the grammar is and that the
> ecpg tools only parse that one file. Why putting effort into writing it
> down too?

I did manage to fix the "die" commands so that you get something like

unterminated rule at grammar line 1461

without the extraneous detail about the script's internals.
That seems clear enough from here.

I'm still disturbed by the scripts' ability to get fooled by
braces or comment markers within quoted strings.  However, that's
not something I have good ideas about how to fix, and there's not
any evidence that it's a live problem at the moment.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: variadic argument support for least, greatest function
Next
From: Christophe Pettus
Date:
Subject: Re: Remove Deprecated Exclusive Backup Mode