Raise PostgresException if queries does not return expected row.