Re: ON CONFLICT DO NOTHING on pg_dump

From: Surafel Temesgen <surafel3000(at)gmail(dot)com>
To: "Ideriha, Takeshi" <ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ON CONFLICT DO NOTHING on pg_dump
Date: 2018-06-14 10:39:00
Message-ID: CALAY4q-ayNZCd95NdAwf8E7wLswRzHaYX9XT+eHqu_C6OSqjRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 12, 2018 at 12:05 PM, Ideriha, Takeshi <
ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com> wrote:
thank you for the review

> 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.
>
> >The attache patch add --on-conflect-do-nothing option to pg_dump in order
> to do the above.
>
> The followings are some comments.
>
> + <term><option>--on-conflect-do-nothing</option></term>
> Here's a typo: conflect -> conflict. This typo also applies to pg_dump.c
>
> printf(_(" --inserts dump data as INSERT
> commands, rather than COPY\n"));
> + printf(_(" --on-conflect-do-nothing dump data as INSERT
> commands with on conflect do nothing\n"));
> printf(_(" --no-comments do not dump comments\n"));
>
> The output of help should be in alphabetical order according to the
> convention. So changing the order seems logical.
> Please apply my review to the documentation as well.
> By the way, 4d6a854 breaks the patch on this point.
>
> + This option is not valid unless <option>--inserts</option> is
> also specified.
> + </para>
>
> + if (dopt.do_nothing && !dopt.dump_inserts)
> + exit_horribly(NULL, "option --on-conflect-do-nothing
> requires option --inserts\n");
>
> How about mentioning --column-inserts? --on-conflict-do-nothing with
> --column-inserts should work.
>
fixed

>
> Do you have any plan to support on-conlict-do-update? Supporting this
> seems to me complicated and take much time so I don't mind not implementing
> this.
>
i agree its complicated and i don't have a plan to implementing it.

> What do you think about adding some test cases?
> command_fails_like() at 001_basic.pl checks command fail pattern with
> invalid comnibation of option.
> And 002_pg_dump.pl checks the feature iteself.
>
thank you for pointing me that i add basic test and it seems to me the rest
of the test is covered by column_inserts test

> Regards,
> Takeshi Ideriha
>

Attachment Content-Type Size
pg_dump_onConflect_v2.pach application/octet-stream 7.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikhil Sontakke 2018-06-14 11:02:06 Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding
Previous Message David Rowley 2018-06-14 10:20:23 Re: ntile() throws ERROR when hashagg is false