From: Michael Fuhr <mike@fuhr.org>
To: JiangWei <jw.pgsql@sduept.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [C API] Is there a nice way to get table/column name on some error ?
Date: Thu, 5 Jan 2006 19:11:49 -0700
Message-ID: <20060106021149.GA80657@winnie.fuhr.org> (raw)
In-Reply-To: <43BDC8B4.6020801@sduept.com>
References: <43BDC8B4.6020801@sduept.com>
[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: mike@fuhr.org, jw.pgsql@sduept.com
Subject: Re: [C API] Is there a nice way to get table/column name on some error ?
In-Reply-To: <20060106021149.GA80657@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox