How can I obtain the codes described in Appendix A in the PG Docs through PHP? I'd like to avoid to patch PHP as proposed here: http://it.php.net/manual/en/function.pg-result-error.php I'm not interested in the message but just the code. Is there any workaround that doesn't involve recompiling php? Anyone know the code for a duplicate PK violation? thx