Re: PATCH: pg_dump to support "on conflict do update" - Mailing list pgsql-hackers

From Laurenz Albe
Subject Re: PATCH: pg_dump to support "on conflict do update"
Date
Msg-id d7fe9dc9f3e020e16f9121074b2ddeb33c350ee8.camel@cybertec.at
Whole thread Raw
In response to PATCH: pg_dump to support "on conflict do update"  (Tanin Na Nakorn <tanin47@gmail.com>)
Responses Re: PATCH: pg_dump to support "on conflict do update"
List pgsql-hackers
On Sat, 2025-05-03 at 22:47 -0700, Tanin Na Nakorn wrote:
> Here's the patch (against the latest master) that will make pg_dump support "on conflict do update" .
>
> I've used this patch on v16 for our company's CI (on Github Actions), and it works perfectly fine.
>
> Users would be able to use it like this:
>
> ./src/bin/pg_dump/pg_dump $DATABASE_URL \
>             --table=some_random_table \
>             --data-only \
>             --on-conflict-target-columns url,payload_checksum \
>             --on-conflict-update-clause='last_used_at=EXCLUDED.last_used_at' \
>             --inserts \
>             --rows-per-insert=10 \
>             --no-sync \
>             --file=/tmp/test.dump
>
> There are 3 caveats:
>
> 1. The "on conflict do update" would apply to every table. In my opinion, this is fine.

I don't think that is fine.  I think it would make the feature unusable for most cases.
At the very least, there would have to be a way to specify which tables are affected.

Yours,
Laurenz Albe



pgsql-hackers by date:

Previous
From: Yura Sokolov
Date:
Subject: SpinLockAcquire and SpinLockRelease is broken on ARM/ARM64? (Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum)
Next
From: Bertrand Drouvot
Date:
Subject: Fix a race condition in ConditionVariableTimedSleep()