Re: Access last_sqlstate from libpq

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Access last_sqlstate from libpq
Дата
Msg-id CAKFQuwb+SoR3CtZcnsueoir0U5ozdis-o1MZP1+fLz-jozQGYQ@mail.gmail.com
обсуждение исходный текст
Ответ на Access last_sqlstate from libpq  (Daniel Frey <d.frey@gmx.de>)
Ответы Re: Access last_sqlstate from libpq  (Daniel Frey <d.frey@gmx.de>)
Список pgsql-hackers


On Friday, September 17, 2021, Daniel Frey <d.frey@gmx.de> wrote:

However, this is not possible in a couple of other cases where I don't have a PGresult*, only the PGconn* is available:

* PQconnectdb (and variants)

* PQputCopyData
* PQputCopyEnd
* PQgetCopyData

* lo_* (large object functions)

After some research, it appears that PGconn* does have a field called last_sqlstate - it just can't be accessed.
Are there any problems adding a simple accessor to libpq? Or is there some way to access it that I'm missing?

I suspect the reason for the omission is that there isn’t any usable data to be gotten.  Those interfaces are not SQL interfaces and thus do not have a relevant last_sqlstate to report.

David J.

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

Предыдущее
От: Daniel Frey
Дата:
Сообщение: Access last_sqlstate from libpq
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: postgres.h included from relcache.h - but removing it breaks pg_upgrade