[Please post in plain text, not HTML.]
On Fri, Jan 06, 2006 at 10:15:19AM +0800, JiangWei wrote:
> > 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?
>
> No. I want to throw a exception with the column name, like this :
> if (sqlstate == undefined_column)
> throw UnknownProperty(column_name);
I'm not aware of a way to get just the column name, so if nobody
else posts a way then you might have to parse the error message
(admittedly a pain, especially if you have to deal with different
languages).
--
Michael Fuhr