How to resume an aborted transaction - Mailing list pgsql-sql

From Martin Neumann
Subject How to resume an aborted transaction
Date
Msg-id m11MCBW-000DLPC@darwin.oche.de
Whole thread Raw
List 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



pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [SQL] entries in pg_shadow
Next
From: Martin Neumann
Date:
Subject: ...