Добрый день !
как в PG узнать была ли ошибка или нет ?в mssql так :
insert ttt(id) values(2)IF @@ERROR<>0 тогда ошибка...........