Search Postgresql Archives

insert continue on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux