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 2EFD09DCA2F for ; Thu, 5 Jan 2006 22:11:52 -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 64090-03 for ; Thu, 5 Jan 2006 22:11:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id C89819DCA0A for ; Thu, 5 Jan 2006 22:11:49 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k062Bo6d000664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Jan 2006 19:11:52 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id k062BoJ0080756; Thu, 5 Jan 2006 19:11:50 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id k062BnaF080755; Thu, 5 Jan 2006 19:11:49 -0700 (MST) (envelope-from mfuhr) Date: Thu, 5 Jan 2006 19:11:49 -0700 From: Michael Fuhr To: JiangWei Cc: pgsql-interfaces@postgresql.org Subject: Re: [C API] Is there a nice way to get table/column name on some error ? Message-ID: <20060106021149.GA80657@winnie.fuhr.org> References: <43BDC8B4.6020801@sduept.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43BDC8B4.6020801@sduept.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.074 required=5 tests=[AWL=0.074] X-Spam-Score: 0.074 X-Spam-Level: X-Archive-Number: 200601/4 X-Sequence-Number: 5920 [Please post in plain text, not HTML.] On Fri, Jan 06, 2006 at 09:32:36AM +0800, JiangWei wrote: > 42703 UNDEFINED COLUMN undefined_column > 42883 UNDEFINED FUNCTION undefined_function > 42P01 UNDEFINED TABLE undefined_table > > I want to know which column undefined when "undefined_column" Happen > at run time. With libpq you can call PQerrorMessage(), PQresultErrorMessage(), or PQresultErrorField() to get a string that should identify the offending column, function, table, etc. Will that work for your purpose? -- Michael Fuhr