How to resume an aborted transaction

From: Martin Neumann <mne(at)darwin(dot)oche(dot)de>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: How to resume an aborted transaction
Date: 1999-09-01 15:20:21
Message-ID: m11MCBW-000DLPC@darwin.oche.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Every day I get a plain-vanilla ASCII-file containg space-separated
values. I parse the file with a script and make each row in the file an
INSERT-statement. Sometimes one of these many statements contains
rubbish becaused the line in the file I was processing contained
rubbish.

If I did a separate transaction for every INSERT-statement this doesn't
hurt because only one statement (the broken one) doesn't get processed.

But I have to do about 100.000 INSERTs everyday and this is _slow_ if I
let PostgreSQL process each statement individually.

So my idea was to use a chained transaction. This works perfectly as
long as all INSERT-statement are okay. But if one is broken, PostgreSQL
doesn't process the other statements, too.

My goal is to use chained transaction and to don't have to bother
about broken INSERT-statements. Is that possible or to do I have to
check the statements manually (by the script) before executing?

--
`Unser Kopf ist rund, damit das Denken die Richtung wechseln kann.'
~ Francis Picabia

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1999-09-01 15:45:46 Re: [SQL] Newbie dbadmin out of his league
Previous Message marten 1999-09-01 13:59:51 Documentation for Decimal ...