Re: [Bug Fix] ECPG: could not use set xxx to default statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, "Higuchi, Daisuke" <higuchi(dot)daisuke(at)jp(dot)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Bug Fix] ECPG: could not use set xxx to default statement
Date: 2019-02-24 17:59:21
Message-ID: 2883.1551031161@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Meskes <meskes(at)postgresql(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mithun Cy 2019-02-24 18:40:49 Re: BUG #15641: Autoprewarm worker fails to start on Windows with huge pages in use Old PostgreSQL community/pgsql-bugs x
Previous Message Pavel Stehule 2019-02-24 17:51:12 Re: proposal: variadic argument support for least, greatest function