I am fetching PostgreSQL(13) data with some modifications from remote database, pushing it to another database, I want rollback first one if second one failed to commit (like lost connection), and vise versa, my problem if first one commit success, second one failed, how to roll back comited first one?
Is there any technique in Postgresql to do that?