Possible to prevent transaction abort?

From: Adam B <adamb(at)videx(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Possible to prevent transaction abort?
Date: 2009-05-01 17:50:04
Message-ID: 49FB364C.1050301@videx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

Is it possible to prevent Postgre from aborting the transaction upon a
constraint violation?

Using JDBC if I catch the constraint violation and try another statement
I get:

/ERROR: current transaction is aborted, commands ignored until end of
transaction block/

I realize that I could set a save-point before every INSERT but that
nearly doubles the processing time. Since our application INSERTS many
thousands of rows at a time we need maximum efficiency. On Mysql (where
this limitation doesn't exist) it's already only barely fast enough. If
we have to use savepoints with Postgre it might prevent us from making
the switch.

Is there some mode flag I could set, either database or server wide?
I've found Postgre to be wonderfully configurable so I'm crossing my
fingers...

Much Thanks.
- Adam

Videx Inc. 1105 N. E. Circle Blvd. Corvallis OR 97330 (541) 758-0521
CONFIDENTIAL COMMUNICATION: The email message and any attachments are intended only for the addressee. They may be privileged, confidential, and protected from disclosure. If you are not the intended recipient, any dissemination, distribution, or copying is expressly prohibited. If you received this email message in error, please notify the sender immediately by replying to this e-mail message or by telephone

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-05-01 18:06:42 Re: Online Backups PostGre
Previous Message David Wall 2009-05-01 17:49:03 Handling large number of OR/IN conditions