RE: ON CONFLICT DO NOTHING on pg_dump

From: "Ideriha, Takeshi" <ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com>
To: Nico Williams <nico(at)cryptonector(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Surafel Temesgen <surafel3000(at)gmail(dot)com>
Subject: RE: ON CONFLICT DO NOTHING on pg_dump
Date: 2018-06-15 02:20:21
Message-ID: 4E72940DA2BF16479384A86D54D0988A567B38A8@G01JPEXMBKW04
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>-----Original Message-----
>From: Nico Williams [mailto:nico(at)cryptonector(dot)com]
>On Tue, Jun 12, 2018 at 09:05:23AM +0000, Ideriha, Takeshi wrote:
>> >From: Surafel Temesgen [mailto:surafel3000(at)gmail(dot)com]
>> >Subject: ON CONFLICT DO NOTHING on pg_dump
>>
>> >Sometimes I have to maintain two similar database and I have to update one from
>the other and notice having the option to add ON CONFLICT DO NOTHING clause to
>>INSERT command in the dump data will allows pg_restore to be done with free of
>ignore error.
>>
>> Hi,
>> I feel like that on-conflict-do-nothing support is useful especially coupled with
>--data-only option.
>> Only the difference of data can be restored.
>
>But that's additive-only. Only missing rows are restored this way, and differences are
>not addressed.
>
>If you want restore to restore data properly and concurrently (as opposed to renaming
>a new database into place or whatever) then you'd want a) MERGE, b) dump to
>generate MERGE statements. A concurrent data restore operation would be rather
>neat.

I agree with you though supporting MERGE or ON-CONFLICT-DO-UPDATE seems hard work.
Only ON-CONCLICT-DO-NOTHING use case may be narrow.

--
Takeshi

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-06-15 02:38:14 Re: Partitioning with temp tables is broken
Previous Message David Rowley 2018-06-15 01:59:34 Re: Partitioning with temp tables is broken