Re: Patch for Improved Syntax Error Reporting

From: Neil Padgett <npadgett(at)redhat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fernando Nasser <fnasser(at)cygnus(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, "pgsql-patches(at)postgresql(dot)org" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Patch for Improved Syntax Error Reporting
Date: 2001-08-01 22:38:29
Message-ID: 3B6884E5.5CA1CDE4@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
>
> Fernando Nasser <fnasser(at)cygnus(dot)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(at)redhat(dot)com
2323 Yonge Street, Suite #300,
Toronto, ON M4P 2C9

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-08-01 22:51:35 Re: Patch for Improved Syntax Error Reporting
Previous Message Rene Pijlman 2001-08-01 22:29:21 Re: What needs to be done?

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-08-01 22:51:35 Re: Patch for Improved Syntax Error Reporting
Previous Message Tom Lane 2001-08-01 22:22:00 Re: Patch for Improved Syntax Error Reporting