RE: how to continue a transaction after an error?

From: "Edmar Wiggers" <edmar(at)brasmap(dot)com>
To: "Cristi Petrescu-Prahova" <cristipp(at)lasting(dot)ro>, <pgsql-sql(at)postgresql(dot)org>
Subject: RE: how to continue a transaction after an error?
Date: 2000-11-13 20:13:13
Message-ID: NEBBIAKDCDHFGJMLHCKIGECLCBAA.edmar@brasmap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


I believe the known mechanism to cope with errors inside transactions are
savepoints. That doesn't seem to be the case, though.

If you don't care if some inserts fail, then you have multiple transactions
instead of just one (use autocommit).

If you want a transaction, check existence before each insert. That's the
way to do it.

> -----Original Message-----
> I would like to insert a bunch of rows in a table in a
> transaction. Some of
> the insertions will fail due to constraints violation. When this happens,
> Postgres automatically ends the transaction and rolls back all
> the previous
> inserts. I would like to continue the transaction and issue the
> commit/rollback command myself.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Marten Feldtmann 2000-11-13 20:18:49 Re: Using a postgres table to maintain unique id?
Previous Message Ross J. Reedstrom 2000-11-13 20:08:08 Re: how to continue a transaction after an error?