pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edmar Wiggers <edmar@brasmap.com>
To: Cristi Petrescu-Prahova <cristipp@lasting.ro>
To: pgsql-sql@postgresql.org
Subject: RE: how to continue a transaction after an error?
Date: Mon, 13 Nov 2000 18:13:13 -0200
Message-ID: <NEBBIAKDCDHFGJMLHCKIGECLCBAA.edmar@brasmap.com> (raw)
In-Reply-To: <002e01c04da9$a8f95c20$25efe6c1@lasting.ro>


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.




view thread (10+ messages)  latest in thread

Message-ID: <NEBBIAKDCDHFGJMLHCKIGECLCBAA.edmar@brasmap.com>
Permalink:  ../NEBBIAKDCDHFGJMLHCKIGECLCBAA.edmar@brasmap.com/
Also on:    postgresql.org/message-id/NEBBIAKDCDHFGJMLHCKIGECLCBAA.edmar@brasmap.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: edmar@brasmap.com, cristipp@lasting.ro
  Subject: Re: how to continue a transaction after an error?
  In-Reply-To: <NEBBIAKDCDHFGJMLHCKIGECLCBAA.edmar@brasmap.com>
  References: <002e01c04da9$a8f95c20$25efe6c1@lasting.ro> <NEBBIAKDCDHFGJMLHCKIGECLCBAA.edmar@brasmap.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox