Re: [C API] Is there a nice way to get table/column name on some error ?
В списке pgsql-interfaces по дате отправления:
| От | 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
|
| Список | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера