Re: [PATCHES] Proposed patch for error locations

2006-03-13 Thread Christopher Kings-Lynne
from all libpq-using applications not just psql. We could make this conditional on the error verbosity --- in "terse" mode the "LINE N" output wouldn't appear, and "at character N" still would. Applications should already be expecting multiline outputs from PQerrorMessage if they're in non-terse

Re: [PATCHES] Proposed patch for error locations

2006-03-13 Thread Tom Lane
Martijn van Oosterhout writes: > My only comment is: Wouldn't it be clearer in the long run to create a > ParseNode base structure which is used in place of NodeTag for > parsenodes, and put the "int location" in there. Only if we really wanted *every* parse node to carry a location, which I thin

Re: [PATCHES] Proposed patch for error locations

2006-03-13 Thread Tom Lane
[ cross-posting to pgsql-interfaces in hopes of drawing more comments ] Michael Glaesemann <[EMAIL PROTECTED]> writes: > On Mar 13, 2006, at 2:37 , Tom Lane wrote: >> http://archives.postgresql.org/pgsql-patches/2006-03/msg00153.php > This looks really nice. >> One thing I'm noticing already is

Re: [PATCHES] Proposed patch for error locations

2006-03-13 Thread Fabien COELHO
Dear Tom, I haven't gone further than making it finger the locations of bogus column references, operators, and functions --- it's probably worth improving TypeCast and maybe a few other raw-parse-tree constructs too. Yes. Other area would also benefit, such as type names: psql: CREATE FUNCT

Re: [PATCHES] Proposed patch for error locations

2006-03-13 Thread Martijn van Oosterhout
> The attached WIP patch improves the parser so that cursor positions > can be attached to many errors reported during parse analysis, such > as complaints about nonexistent columns or functions. This is along > the lines proposed in my rant here: > http://archives.postgresql.org/pgsql-patches/20

Re: [PATCHES] Proposed patch for error locations

2006-03-12 Thread Michael Glaesemann
On Mar 13, 2006, at 2:37 , Tom Lane wrote: to wit, that we make use of bison's "locations" feature to track token positions in the grammar, and add locations to raw parse tree nodes as needed. Some examples of what it can do: This looks really nice. One thing I'm noticing already is that th

[PATCHES] Proposed patch for error locations

2006-03-12 Thread Tom Lane
The attached WIP patch improves the parser so that cursor positions can be attached to many errors reported during parse analysis, such as complaints about nonexistent columns or functions. This is along the lines proposed in my rant here: http://archives.postgresql.org/pgsql-patches/2006-02/msg00