pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: me nefcanto <sn.1361@gmail.com>
To: Zhang Mingli <zmlpostgres@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Bug in copy
Date: Sun, 09 Feb 2025 07:02:07 +0100
Message-ID: <3a1189c579c1e0189f3aae60d2cdf7b7dcd6c1cd.camel@cybertec.at> (raw)
In-Reply-To: <CAEHBEOB2LOaDZycmkjcYDG6JJF0_kFX3gc9H+ZrL=cPNF+WnOg@mail.gmail.com>
References: <CAEHBEOBCweDWGNHDaUk4=10HG0QXXJJAGXbEnFLMB30M+Qw+dg@mail.gmail.com>
	<fa5c934f-9b57-4900-ad15-bb9c6d9d414d@Spark>
	<CAEHBEOB2LOaDZycmkjcYDG6JJF0_kFX3gc9H+ZrL=cPNF+WnOg@mail.gmail.com>

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





view thread (14+ messages)  latest in thread

Message-ID: <3a1189c579c1e0189f3aae60d2cdf7b7dcd6c1cd.camel@cybertec.at>
Permalink:  ../3a1189c579c1e0189f3aae60d2cdf7b7dcd6c1cd.camel@cybertec.at/
Also on:    postgresql.org/message-id/3a1189c579c1e0189f3aae60d2cdf7b7dcd6c1cd.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: laurenz.albe@cybertec.at, sn.1361@gmail.com, zmlpostgres@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Bug in copy
  In-Reply-To: <3a1189c579c1e0189f3aae60d2cdf7b7dcd6c1cd.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox