Does Postgres always automatically rollback transactions when an SQL command fails?

From: Ryan Ho <ryanho(at)pacific(dot)net(dot)sg>
To:
Cc: "<Postgres Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Does Postgres always automatically rollback transactions when an SQL command fails?
Date: 2001-04-22 16:50:34
Message-ID: 3AE30BD9.A87DF57B@pacific.net.sg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

In a transaction, should any of the sql statements fail to execute, does Postgres rollback all the previous statements?

To my best knowledge, it should but I have observed that on some occasions, half my transaction can get committed, while the other half is unsuccessful.

Do I need check for failed transactions and enforce a rollback in my code or is it done by the backend automatically?

Thanks in advance
Ryan

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Steve Waldman 2001-04-22 21:19:50 Re: BLOB Type ?
Previous Message Ryan Ho 2001-04-22 16:49:07 Re: BLOB Type ?