Re: Bug in copy
От | me nefcanto |
---|---|
Тема | Re: Bug in copy |
Дата | |
Msg-id | CAEHBEOD7QrxcsAh09qydomb4sV_HoZ4y+_C9-8pudJ8NDha=Tg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Bug in copy (Zhang Mingli <zmlpostgres@gmail.com>) |
Ответы |
Re: Bug in copy
|
Список | pgsql-bugs |
@laurenz if I use `insert into` or the `merge` would I be able to bypass records with errors? Or would I fail there too? I mean there are lots of ways a record can be limited. Unique indexes, check constraints, foreign key constraints, etc. What happens in those cases?
And why not fixing the "on_error ignore" in the first place? Maybe that would be a simpler way. I don't know the internals of bulk insertion, but if at some point it has a loop in it, then that's much simpler to catch errors in that loop.
And why not fixing the "on_error ignore" in the first place? Maybe that would be a simpler way. I don't know the internals of bulk insertion, but if at some point it has a loop in it, then that's much simpler to catch errors in that loop.
Regards
Saeed
On Sun, Feb 9, 2025 at 9:32 AM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
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
В списке pgsql-bugs по дате отправления: