Filter error log statements by sqlstate

https://commitfest.postgresql.org/action/patch_view?id=1360
http://archives.postgresql.org/message-id/20140114135530.GB28072@saarenmaa.fi