Sergey Fukanchik <s(dot)fukanchik(at)postgrespro(dot)ru> writes:> Does libpq have an API to extract this code?
PQresultErrorField(res, PG_DIAG_SQLSTATE) should do, no?
regards, tom lane