Re: Access last_sqlstate from libpq

2021-09-17 Thread Daniel Frey
> On 18. Sep 2021, at 01:45, David G. Johnston > wrote: > > > > On Friday, September 17, 2021, Daniel Frey wrote: > > However, this is not possible in a couple of other cases where I don't have a > PGresult*, only the PGconn* is available:

Access last_sqlstate from libpq

2021-09-17 Thread Daniel Frey
Hi, I am the author of a PostgreSQL C++ client library, taoPQ (https://github.com/taocpp/taopq), wrapping the C-API of libpq. In case of an error when I received a PGresult*, I can access the SQLSTATE by calling PGresult* pgresult = ...; const char* sqlstate = PQresultErrorField( pgresul