Re: [C API] Is there a nice way to get table/column - Mailing list pgsql-interfaces

From JiangWei
Subject Re: [C API] Is there a nice way to get table/column
Date
Msg-id 43BDD2B7.2090609@sduept.com
Whole thread Raw
In response to Re: [C API] Is there a nice way to get table/column name on some error ?  (Michael Fuhr <mike@fuhr.org>)
Responses Re: [C API] Is there a nice way to get table/column name on some error ?
List pgsql-interfaces
Michael Fuhr wrote: <blockquote cite="mid20060106021149.GA80657@winnie.fuhr.org" type="cite"><pre wrap="">[Please post
inplain text, not HTML.]
 

On Fri, Jan 06, 2006 at 09:32:36AM +0800, JiangWei wrote: </pre><blockquote type="cite"><pre wrap="">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.   </pre></blockquote><pre wrap="">
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?
 </pre></blockquote> No.  I want to throw a exception with  the column name, like this :<br /><br /> if (sqlstate ==
undefined_column)<br/>   throw UnknownProperty(column_name);<br /><br /><br /> 

pgsql-interfaces by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: [C API] Is there a nice way to get table/column name on some error ?
Next
From: Michael Fuhr
Date:
Subject: Re: [C API] Is there a nice way to get table/column name on some error ?