Patch looks good to me now. I have found no issues too. It is good to go in now.
However, few small suggestions:
1. Whenever we know that a variable is containing only 32 bits, better define it as uint32 and not just int (m_sqlstate in get_sqlstate_error_level() function). int size may differ in size on different platforms. 2. Also always cast the results with the actual return type of the function.
These are my views. Current code has absolutely no issues as such (at least on my machine).
Assigning back to you for your views on above points. If you are agree resend the patch with changes else feel free to mark it as "Ready for Committor".
Thanks
--
Jeevan B Chalke Principal Software Engineer, Product Development EnterpriseDB Corporation The Enterprise PostgreSQL Company