You can use savepoints (see the manual) to recover from errors, though they have some issues if you use hundreds of thousands of savepoints in a single transaction. It's much better to check the data on INSERT to make sure it's OK. You can do this with an INSERT ... SELECT (and check the rowcount), with a PL/PgSQL function that returns a result value, do it client-side, etc.
can you post an example ? would that also resolve problem with 'rowcount' left unset, if trigger or rule is used on table ?
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.