Re: Proposed p.tch for error locations - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Proposed p.tch for error locations
Date
Msg-id 7693.1142265427@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposed p.tch for error locations  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Proposed p.tch for error locations  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-interfaces
Alvaro Herrera <alvherre@commandprompt.com> writes:
> This doesn't work on terminal using a variable-width font, does it?
> Sure, you can have all the interfaces use a monospace font, but it seems
> a weird thing to do.  I think the line/character position should be
> returned in a separate error attribute in ereport.  So for example
> pgAdmin could count characters and mark it in bold or use a different
> color.

That information is already available to pgAdmin, and has been since
7.4; if they are failing to exploit it that's their problem not libpq's.

Basically what's at stake here is the behavior of "dumb" applications
that are just using PQerrorMessage and not doing anything smart with
error message fields.  It does not seem unreasonable to me to assume
fixed-width font in that context.  We haven't seen any complaints about
psql doing it have we?

            regards, tom lane

pgsql-interfaces by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Proposed p.tch for error locations
Next
From: Volkan YAZICI
Date:
Subject: Re: Receiving SIGPIPE for PQfinish()