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
|
Список | 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 по дате отправления: