insert continue on error

Поиск
Список
Период
Сортировка
От Tom Hart
Тема insert continue on error
Дата
Msg-id 4715130A.7020102@coopfed.org
обсуждение исходный текст
Ответы Re: insert continue on error  (Raymond O'Donnell <rod@iol.ie>)
Re: insert continue on error  (Sam Mason <sam@samason.me.uk>)
Список 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 по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: need help with rebuilding postgresql
Следующее
От: Guy Rouillier
Дата:
Сообщение: Re: How to set config param temporarily?