Re: JDBC behaviour

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC behaviour
Date: 2016-02-20 17:41:20
Message-ID: naa8g5$sv4$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Cramer 2016-02-20 17:42:12 Re: JDBC behaviour
Previous Message Vitalii Tymchyshyn 2016-02-20 17:34:39 Re: JDBC behaviour

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2016-02-20 17:42:12 Re: JDBC behaviour
Previous Message Vitalii Tymchyshyn 2016-02-20 17:34:39 Re: JDBC behaviour

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2016-02-20 17:42:12 Re: JDBC behaviour
Previous Message Vitalii Tymchyshyn 2016-02-20 17:34:39 Re: JDBC behaviour