Re: [C API] Is there a nice way to get table/column name on some error ?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: [C API] Is there a nice way to get table/column name on some error ?
Дата
Msg-id 20060106040158.GA81499@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: [C API] Is there a nice way to get table/column  (JiangWei <jw.pgsql@sduept.com>)
Ответы Re: [C API] Is there a nice way to get table/column  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
Список pgsql-interfaces
[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


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: JiangWei
Дата:
Сообщение: Re: [C API] Is there a nice way to get table/column
Следующее
От: "Jeroen T. Vermeulen"
Дата:
Сообщение: Re: [C API] Is there a nice way to get table/column