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

From Tom Lane
Subject Re: Patch for Improved Syntax Error Reporting
Date
Msg-id 14696.996795002@sss.pgh.pa.us
Whole thread Raw
In response to Re: Patch for Improved Syntax Error Reporting  (Neil Padgett <npadgett@redhat.com>)
Responses Re: Patch for Improved Syntax Error Reporting  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Neil Padgett <npadgett@redhat.com> writes:
>> I like the idea of putting the formatting stuff in libpq.  It
>> centralizes it, and allows the client to control the formatting too.

> What exactly would you put in libpq?

I think we could put in code that parses the multi-line error message
format, and returns preparsed data in the form of a list of field names
and field values.  I don't see that libpq can do anything useful with
producing a syntax-error pointer, since it doesn't have access to the
original user query string, only to the same string that's sent to the
backend; so as far as it can know, the error index that the backend
returns is gospel.  Any reverse-mapping from that to a user-query index
has got to be in the client app, AFAICS.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Revised Patch to allow multiple table locks in "Unison"
Next
From: Hiroshi Inoue
Date:
Subject: Re: ODBC Boolean handling