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

From Tanin Na Nakorn
Subject pg_dump to support "on conflict do update"
Date
Msg-id CAPSThKnJdyXt3Zsq5dx3N9EYohXo_eYcnP7GVFfCtWXdOuvHog@mail.gmail.com
Whole thread Raw
Responses Re: pg_dump to support "on conflict do update"
Re: pg_dump to support "on conflict do update"
List pgsql-hackers
Hi hackers,

I've made a proof of concept for pg_dump to support "on conflict do update" here: https://github.com/tanin47/postgres/pull/1

It can be used with the following options: --on-conflict-target-columns url,payload_checksum --on-conflict-update-clause='last_used_at=EXCLUDED.last_used_at'

I'd love to go through the process of making a patch and merge it into the repo.

Before doing that, I'd like to improve a few things first, so I have a few questions:

1. I'd love an opinion on whether the options' shapes look fine where --on-conflict-target-columns is a list of columns and --on-conflict-update-clause is a string. Would love some input there.
2. I'd like to add a test but couldn't exactly find a good example for a test on pg_dump. I wonder if anyone can point me to an example or in the right direction.
3. Is it possible to patch this into the version 16 as well as the version 17 and latest main branch? Because I use v16.

Thank you,
Tanin

FYI, I've compiled the code and used this in production. Therefore, I'm not blocked.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fix slot synchronization with two_phase decoding enabled
Next
From: Andrei Lepikhov
Date:
Subject: Re: making EXPLAIN extensible