i'm writing a postgresql function implementing a transaction. this how the code looks like:
BEGIN TRANSACTION REPEATABLE READ
INSERT INTO table1 VALUES(value1, value2);
INSERT INTO table2 VALUES(value3);
COMMIT
END;
Now i need to check if one of the insert query return some kind of error for insert rollback. How can i do it?