add different error format for 23505 error on postgres

Would you guys like me to submit a failing test for this? Do you guys test this kind of thing?

Also, I tried to find somewhere on postgres where it mapped error codes into error messages but I didn't find it. Any idea on if this exists out there? There might be even more error formats for code 23505 or other codes...
Is the resulting error message for the user then 'could not ...' or the original database error?