Re: ON CONFLICT DO NOTHING on pg_dump

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: "Ideriha, Takeshi" <ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com>
Cc: Surafel Temesgen <surafel3000(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: ON CONFLICT DO NOTHING on pg_dump
Date: 2018-07-13 02:02:12
Message-ID: CAEepm=2A_aUfB4A7YvRFciaRHM4euu6or+OzDuEuuZ4mE7QVwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 13, 2018 at 12:33 PM, Ideriha, Takeshi
<ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2018-07-13 02:14:01 Re: pg_create_logical_replication_slot returns text instead of name
Previous Message Michael Paquier 2018-07-13 01:47:38 Re: [HACKERS] WAL logging problem in 9.4.3?