Re: Patch for Improved Syntax Error Reporting - Mailing list pgsql-patches

From Neil Padgett
Subject Re: Patch for Improved Syntax Error Reporting
Date
Msg-id 3B6884E5.5CA1CDE4@redhat.com
Whole thread Raw
In response to Re: Patch for Improved Syntax Error Reporting  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Patch for Improved Syntax Error Reporting
List pgsql-patches
Tom Lane wrote:
>
> Fernando Nasser <fnasser@cygnus.com> writes:
> > If instead of printing:
> > ERROR: A parse error near "foo"
> > we print
> > ERROR: A parse error near "foo" (index=10)
> > it should not affect any of the existing clients.
>
> One objection to this idea is that it doesn't play nicely with
> localization of error message texts.  I'd sooner do
>
>         ERROR: A parse error near "foo"
>         ERRORLOCATION: 10
>
> which doesn't create any problems with localization (there's no
> particular need to translate the keywords, since a client probably
> wouldn't show them to the user anyway).  It's just as backward
> compatible, and not that much uglier for an old client.

I'm not sure how this format causes a problem with localization. The
trailing bracketed text isn't part of the message text -- it's just a
set of fields and values. So, since the keywords aren't really intended
for raw display, they don't require translation. Parsing the format is
no harder, and the raw output isn't as ugly as is a multi-line list of
fields and values, IMHO. (I really dislike unnecessarily having gobs of
output lines in the message.)

Neil

--
Neil Padgett
Red Hat Canada Ltd.                       E-Mail:  npadgett@redhat.com
2323 Yonge Street, Suite #300,
Toronto, ON  M4P 2C9

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch for Improved Syntax Error Reporting
Next
From: Tom Lane
Date:
Subject: Re: Patch for Improved Syntax Error Reporting