Re: [PATCHES] [HACKERS] Better handling of parse errors

2002-08-18 Thread Peter Eisentraut
Gavin Sherry writes: In that case, attached is a patch which locates the beginning of the offending token more efficiently (per your suggestion of using scanbuf). In the regression tests there are a couple of cases that could be improved: In strings.sql: -- illegal string continuation

Re: [PATCHES] [HACKERS] Better handling of parse errors

2002-08-18 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: In strings.sql: -- illegal string continuation syntax SELECT 'first line' ' - next line' /* this comment is not allowed here */ ' - third line' AS Illegal comment within continuation; ERROR: parser: parse error at or near ' - third line'

Re: [PATCHES] [HACKERS] Better handling of parse errors

2002-08-18 Thread Gavin Sherry
On Sun, 18 Aug 2002, Tom Lane wrote: Peter Eisentraut [EMAIL PROTECTED] writes: In strings.sql: -- illegal string continuation syntax SELECT 'first line' ' - next line' /* this comment is not allowed here */ ' - third line' AS Illegal comment within continuation; ERROR:

Re: [PATCHES] [HACKERS] Better handling of parse errors

2002-08-18 Thread Tom Lane
Gavin Sherry [EMAIL PROTECTED] writes: Reworking the code to taken into account token_start seems to work. Yes, I did that last night ... regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive

Re: [PATCHES] [HACKERS] Better handling of parse errors

2002-08-18 Thread Peter Eisentraut
Tom Lane writes: Character 1 is correct as of the context that the parser is working in, namely the function body. I don't think we can do much to change that, but perhaps we could make the message read like ERROR: parser: parse error at or near not at character 1 of function body That

Re: [PATCHES] [HACKERS] Better handling of parse errors

2002-08-18 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: Tom Lane writes: Character 1 is correct as of the context that the parser is working in, namely the function body. I don't think we can do much to change that, but perhaps we could make the message read like ERROR: parser: parse error at or near

Re: [HACKERS] Better handling of parse errors

2002-08-17 Thread Bruce Momjian
Patch applied. Thanks. --- Gavin Sherry wrote: On Wed, 14 Aug 2002, Tom Lane wrote: Gavin Sherry [EMAIL PROTECTED] writes: ... do we want to modify every 7.2 error message? Nyet ... but I don't think tacking

Re: [HACKERS] Better handling of parse errors

2002-08-15 Thread Bruce Momjian
Your patch has been added to the PostgreSQL unapplied patches list at: http://candle.pha.pa.us/cgi-bin/pgpatches I will try to apply it within the next 48 hours. --- Gavin Sherry wrote: On Wed, 14 Aug 2002, Tom

Re: [HACKERS] Better handling of parse errors

2002-08-14 Thread Gavin Sherry
On Wed, 14 Aug 2002, Tom Lane wrote: Gavin Sherry [EMAIL PROTECTED] writes: ... do we want to modify every 7.2 error message? Nyet ... but I don't think tacking an offset onto the end of parse error at or near foo messages is likely to cause the sort of generalized havoc you suggest ...

Re: [HACKERS] Better handling of parse errors

2002-08-13 Thread Bruce Momjian
Gavin, have you answered these issues brought up about the patch? --- Tom Lane wrote: Gavin Sherry [EMAIL PROTECTED] writes: Attached is a small patch to scan.l for consideration. It hands yyerror() the position in

Re: [HACKERS] Better handling of parse errors

2002-08-13 Thread Gavin Sherry
Bruce, I was working on this on the train this morning. There are a few possibilities I'd like to look at before I submit another patch. Before I do, there is one important question that I didn't raise when I submitted the first patch (which was only a proof of concept kind of patch). Namely:

Re: [HACKERS] Better handling of parse errors

2002-08-13 Thread Bruce Momjian
I don't think anyone will mind, but you can throw a message to 'general' just to be sure. --- Gavin Sherry wrote: Bruce, I was working on this on the train this morning. There are a few possibilities I'd like to look

Re: [HACKERS] Better handling of parse errors

2002-08-13 Thread Tom Lane
Gavin Sherry [EMAIL PROTECTED] writes: ... do we want to modify every 7.2 error message? Nyet ... but I don't think tacking an offset onto the end of parse error at or near foo messages is likely to cause the sort of generalized havoc you suggest ... I'm on record as favoring a thorough