Add correct PostgreSQL's exceptions handling