Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] Proposed patch for error locations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: pgsql-patches(at)postgreSQL(dot)org, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [PATCHES] Proposed patch for error locations
Date: 2006-03-13 15:11:31
Message-ID: 7274.1142262691@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-patches
[ cross-posting to pgsql-interfaces in hopes of drawing more comments ]

Michael Glaesemann <grzm(at)myrealbox(dot)com> writes:
> On Mar 13, 2006, at 2:37 , Tom Lane wrote:
>> http://archives.postgresql.org/pgsql-patches/2006-03/msg00153.php

> This looks really nice.

>> One thing I'm noticing already is that the addition of "at character N"
>> to a lot of these messages isn't an improvement.  In psql it's  
>> certainly redundant with the error-cursor display.

> The pure character count is definitely difficult to use with larger  
> queries. I think it could be more useful if it were  
> line:char_of_line. Would others find this useful?

The change in behavior would actually be in libpq, because it's
PQerrorMessage that is doing the deed (assuming a reasonably modern
server and libpq).  What I was considering proposing was that we migrate
the error-cursor feature out of psql and into PQerrorMessage.  This
would mean that you'd get responses like

ERROR:  column "foo" does not exist
LINE 1: select foo from a;
               ^

from all libpq-using applications not just psql.  We could make this
conditional on the error verbosity --- in "terse" mode the "LINE N"
output wouldn't appear, and "at character N" still would.  Applications
should already be expecting multiline outputs from PQerrorMessage if
they're in non-terse mode, so this ought to be OK.  Comments?

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2006-03-13 15:32:09
Subject: Re: Proposed p.tch for error locations
Previous:From: Fabien COELHODate: 2006-03-13 14:22:35
Subject: Re: Proposed patch for error locations

pgsql-interfaces by date

Next:From: Alvaro HerreraDate: 2006-03-13 15:32:09
Subject: Re: Proposed p.tch for error locations
Previous:From: Fabien COELHODate: 2006-03-13 14:22:35
Subject: Re: Proposed patch for error locations

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group