Re: Is there public API to fetch errcode? - Mailing list pgsql-hackers

From Sergey Fukanchik
Subject Re: Is there public API to fetch errcode?
Date
Msg-id f0fa1acc-b994-4d16-8955-8ef8dffe9fb9@postgrespro.ru
Whole thread Raw
In response to Re: Is there public API to fetch errcode?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Is there public API to fetch errcode?
List pgsql-hackers
sqlstate is saved into conn->last_sqlstate along with the error message
in pqGetErrorNotice3:

         if (id == PG_DIAG_SQLSTATE)
             strlcpy(conn->last_sqlstate, workBuf.data,
                     sizeof(conn->last_sqlstate));

is this usable? Can it be extracted somehow?

---

Sergey




pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: GNU/Hurd portability patches
Next
From: Tom Lane
Date:
Subject: Re: Is there public API to fetch errcode?