Re: syntax error position "CREATE FUNCTION" bug fix - Mailing list pgsql-patches

From Fabien COELHO
Subject Re: syntax error position "CREATE FUNCTION" bug fix
Date
Msg-id Pine.LNX.4.58.0403181950040.1388@sablons.cri.ensmp.fr
Whole thread Raw
In response to Re: syntax error position "CREATE FUNCTION" bug fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: syntax error position "CREATE FUNCTION" bug fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: syntax error position "CREATE FUNCTION" bug fix  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Dear Tom,

> > Any GUI can take advantage of the returned string to show it in a window
> > with fancy colors and do any hilighting around the position.
>
> But it cannot (easily) match it up with the *original input*

Sure. Even the parser in the backend cannot do it, that's the problem!;-)

> and put the cursor in the right place in the *input* window.  You are
> envisioning something that's no better than psql with window borders.

I try to envision what is achievable with a reasonnable effort;-)

If I read you correctly, it is all interfaces or none... As a mostly;
psql user, I'm not lucky;-)

I don't think it is really easy to compute the good position wrt to the
original query if you want to keep into account escapes that are eaten by
the first parsing. I can provide a fix that would catch simple cases,
but not all of them.

Would you accept a "it works sometimes, but it may be wrong others" hack?

> My idea of a GUI syntax error report is something that puts my editing
> cursor in the right place.

Thus you decided that you prefer that NO interface should be able to show
the correct position, rather than having at least one to do it, and other
being able to display something, because you decided that the only place
to show something in a GUI is in the initial window or never. You don't
like dialog box, I guess;-)

Have a nice day,

--
Fabien Coelho - coelho@cri.ensmp.fr

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: syntax error position "CREATE FUNCTION" bug fix
Next
From: Tom Lane
Date:
Subject: Re: syntax error position "CREATE FUNCTION" bug fix