Logg errors during UPDATE

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Logg errors during UPDATE
Date: 2008-12-12 09:34:51
Message-ID: ghtb7r$94v$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

with Oracle I have the ability to tell the system to log errors during a long transaction into a separate table and proceed with the statement. This is quite handy when updating large tables and the update for one out of a million rows fails.

The syntax is something like this:

UPDATE <affecting a lot of rows>
LOG ERRORS INTO target_log_table;

Any row that can not be updated will logged into the specified table (which needs to have a specific format of course) and the statement continues. You can add a limit on how many errors should be "tolerated".
This works for INSERT and DELETE as well.

Is there something similar in Postgres? Or a way how I could simulate this?

Cheers
Thomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ivan Sergio Borgonovo 2008-12-12 12:02:29 create table as vs. create table like
Previous Message Dave Page 2008-12-12 09:16:19 Re: [GENERAL] Tool to converter plsql in pgplsql