Re: [PATCHES] Better handling of parse errors - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCHES] Better handling of parse errors
Date
Msg-id Pine.LNX.4.44.0208172002500.13988-100000@localhost.localdomain
Whole thread Raw
In response to Re: Better handling of parse errors  (Gavin Sherry <swm@linuxworld.com.au>)
Responses Re: [PATCHES] Better handling of parse errors  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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 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'" at character 89

Character 89 is the end of the "third line" line, but the parse error is
at the beginning of that line.

In create_function_1.sql:

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql   AS 'not even SQL';
ERROR:  parser: parse error at or near "not" at character 1

Clearly confusing.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: Remove implicit unique index creation on SERIAL columns?
Next
From: Peter Eisentraut
Date:
Subject: Re: Open 7.3 items