X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AC0359DCCD9; Mon, 13 Mar 2006 11:11:29 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66787-02; Mon, 13 Mar 2006 11:11:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6C1729DCCD2; Mon, 13 Mar 2006 11:11:27 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k2DFBVsj007275; Mon, 13 Mar 2006 10:11:31 -0500 (EST) To: Michael Glaesemann cc: pgsql-patches@postgreSQL.org, pgsql-interfaces@postgreSQL.org Subject: Re: [PATCHES] Proposed patch for error locations In-reply-to: References: <5114.1142185055@sss.pgh.pa.us> Comments: In-reply-to Michael Glaesemann message dated "Mon, 13 Mar 2006 16:42:59 +0900" Date: Mon, 13 Mar 2006 10:11:31 -0500 Message-ID: <7274.1142262691@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.112 required=5 tests=[AWL=0.112] X-Spam-Score: 0.112 X-Spam-Level: X-Archive-Number: 200603/9 X-Sequence-Number: 6065 [ cross-posting to pgsql-interfaces in hopes of drawing more comments ] Michael Glaesemann 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