insert continue on error - Mailing list pgsql-general

From Tom Hart
Subject insert continue on error
Date
Msg-id 4715130A.7020102@coopfed.org
Whole thread Raw
Responses Re: insert continue on error  (Raymond O'Donnell <rod@iol.ie>)
Re: insert continue on error  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
Hello everybody.

I'm trying to migrate our data mine from a MS Access backend to a
postgresql backend, and I'm bumping into problems with the conversion.
I've got the basic db and tables set up. I want to transfer data from
one table to another with insert into ...  select from. The from table
and into table both have the same field names, but the types for the
first are all text, and the second are specific (boolean, numeric(10,2),
etc), with cast and custom conversion functions doing the translation.
However every once in a while a record will contain data that I didn't
forsee/wasn't cast properly and the record will bounce. This of course
aborts the entire process.

What I'd like to know is if there's a way to have postgresql still
insert the other rows, and either bounce the bad row to another table,
or log the error in another table/file. I'm sure there's a way to do
this, but I'm still pretty new to postgresql.

TIA for any assistance you can give me.

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: need help with rebuilding postgresql
Next
From: Guy Rouillier
Date:
Subject: Re: How to set config param temporarily?