Re: JDBC behaviour - Mailing list pgsql-jdbc

From Thomas Kellerer
Subject Re: JDBC behaviour
Date
Msg-id naa8g5$sv4$1@ger.gmane.org
Whole thread Raw
In response to Re: JDBC behaviour  (Vitalii Tymchyshyn <vit@tym.im>)
List pgsql-jdbc
Vitalii Tymchyshyn schrieb am 20.02.2016 um 17:01:
> Well, it OT here and belongs to -hackers, but as for me main use case
> here is ETL or ELT process getting a lot of unvalidated external
> data. And a good option to solve this problem is not to change
> transaction semantics or slow down processing by adding tons of
> savepoints, but add "on error" clause to insert/copy statement.
>

You can use INSERT .. ON CONFLICT ... to ignore the erroneous rows
for unique constraint violations.

It's not the same as Oracle's ON ERROR clause, but you don't need savepoints
and you can use JDBC batching with that as well.

For all other constraint violations I usually put the import data into
a staging table anyway - even with Oracle.




pgsql-jdbc by date:

Previous
From: Vitalii Tymchyshyn
Date:
Subject: Re: JDBC behaviour
Next
From: Dave Cramer
Date:
Subject: Re: JDBC behaviour