Re: Save failed records into auxiliary table

From: Il Mimo di Creta <mimo(dot)creta(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Save failed records into auxiliary table
Date: 2020-11-12 16:31:34
Message-ID: CAPDeFrdtJ54Tq2NVr3ywsHiE3bVz=8=B4dHq0jOUPOhNDo9y+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thank you David,
I tried other solutions, but at this point I agree this looks like the most
viable way to solve the problem.

Thank you for your help

On Thu, Nov 12, 2020 at 4:26 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Thu, Nov 12, 2020 at 2:01 AM Il Mimo di Creta <mimo(dot)creta(at)gmail(dot)com>
> wrote:
>
>> I would like to save such records, and only such records, in an auxiliary
>> table.
>>
>
> You will probably need to resort to loading the incoming data into an
> unlogged (and consider temporary) staging table then executing one query to
> load the known good data into the main table and a second query to load the
> known bad data into the auxiliary table. For me this is the most direct
> solution generally anyway and should be used absent a performance problem
> necessitating optimization work.
>
> Upsert isn't going to help you load incoming data into an auxiliary table,
> it can only adjust the data to avoid the conflict relative to the
> referenced table.
>
> David J.
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message John Scalia 2020-11-12 17:42:23 Re: Working with partition tables
Previous Message David G. Johnston 2020-11-12 16:24:58 Re: Working with partition tables