Re: Bug in copy

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: me nefcanto <sn(dot)1361(at)gmail(dot)com>, Zhang Mingli <zmlpostgres(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Bug in copy
Date: 2025-02-09 06:02:07
Message-ID: 3a1189c579c1e0189f3aae60d2cdf7b7dcd6c1cd.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, 2025-02-08 at 09:31 +0330, me nefcanto wrote:
> Inserting a million records not in an all-or-fail is a requirement. What options do we have for that?

Use COPY to load the data into a new (temporary?) table.
Then use INSERT INTO ... SELECT ... ON CONFLICT ... or MERGE to merge
the data from that table to the actual destination.

COPY is not a full-fledged ETL tool.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message me nefcanto 2025-02-09 12:30:11 Re: Bug in copy
Previous Message David G. Johnston 2025-02-08 06:11:45 Re: Bug in copy