Re: ON CONFLICT DO NOTHING on pg_dump - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: ON CONFLICT DO NOTHING on pg_dump
Date
Msg-id CAEepm=2A_aUfB4A7YvRFciaRHM4euu6or+OzDuEuuZ4mE7QVwg@mail.gmail.com
Whole thread Raw
In response to RE: ON CONFLICT DO NOTHING on pg_dump  ("Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>)
Responses RE: ON CONFLICT DO NOTHING on pg_dump  ("Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>)
List pgsql-hackers
On Fri, Jul 13, 2018 at 12:33 PM, Ideriha, Takeshi
<ideriha.takeshi@jp.fujitsu.com> wrote:
>>+        Add ON CONFLICT DO NOTHING clause in the INSERT commands.
>>
>>I think this would be better as: Add <literal>ON CONFLICT DO NOTHING</literal> to
>><command>INSERT</command> commands.
>
> Agreed.
>
>>+    printf(_("  --on-conflict-do-nothing     dump data as INSERT
>>commands with ON CONFLICT DO NOTHING \n"));
>>
>>That's slightly misleading... let's just use the same wording again, eg "add ON
>>CONFLICT DO NOTHING to INSERT commands".
>
> Agreed. But you forgot fixing it at pg_dump.c.
> So could you please fix this and commit it?

Right, thanks.

I noticed one more thing: pg_dumpall.c doesn't really need to prohibit
--on-conflict-do-nothing without --insert.  Its existing validation
rejects illegal combinations of the settings that are *not* passed on
to pg_dump.  It seems OK to just pass those on and let pg_dump
complain.  For example, if you say "pg_dumpall --data-only
--schema-only", it's pg_dump that complains, not pg_dumpall.  I think
we should do the same thing here.

Pushed, with those changes.

Thanks for the patch and the reviews!

-- 
Thomas Munro
http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] WAL logging problem in 9.4.3?
Next
From: Masahiko Sawada
Date:
Subject: Re: pg_create_logical_replication_slot returns text instead of name