RE: ON CONFLICT DO NOTHING on pg_dump

2018-07-12 Thread Ideriha, Takeshi
>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

Re: ON CONFLICT DO NOTHING on pg_dump

2018-07-12 Thread Thomas Munro
On Fri, Jul 13, 2018 at 12:33 PM, Ideriha, Takeshi wrote: >>+Add ON CONFLICT DO NOTHING clause in the INSERT commands. >> >>I think this would be better as: Add ON CONFLICT DO >>NOTHING to >>INSERT commands. > > Agreed. > >>+printf(_(" --on-conflict-do-nothing dump data as

RE: ON CONFLICT DO NOTHING on pg_dump

2018-07-12 Thread Ideriha, Takeshi
Hi, thanks for the revision. > >+Add ON CONFLICT DO NOTHING clause in the INSERT commands. > >I think this would be better as: Add ON CONFLICT DO NOTHING >to >INSERT commands. Agreed. >+printf(_(" --on-conflict-do-nothing dump data as INSERT >commands with ON CONFLICT DO

RE: ON CONFLICT DO NOTHING on pg_dump

2018-07-10 Thread Ideriha, Takeshi
Hi, > The new structure member appears out of place, can you move up along > with other "command-line long options" ? > > > >Done > I did regression tests (make check-world) and checked manually pg_dump --on-conflict-do-nothing works properly. A

RE: ON CONFLICT DO NOTHING on pg_dump

2018-06-26 Thread Ideriha, Takeshi
>> 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. > >Is it narrow, or is it just easy enough to add quickly? Sorry for late replay. I read your comment and rethought about it. What I meant by "narrow" is

Re: ON CONFLICT DO NOTHING on pg_dump

2018-06-18 Thread Nico Williams
On Fri, Jun 15, 2018 at 02:20:21AM +, Ideriha, Takeshi wrote: > >From: Nico Williams [mailto:n...@cryptonector.com] > >On Tue, Jun 12, 2018 at 09:05:23AM +, Ideriha, Takeshi wrote: > >> Only the difference of data can be restored. > > > >But that's additive-only. Only missing rows are

Re: ON CONFLICT DO NOTHING on pg_dump

2018-06-18 Thread Surafel Temesgen
On Sat, Jun 16, 2018 at 11:36 AM, Dilip Kumar wrote: > > @@ -172,6 +172,7 @@ typedef struct _dumpOptions > char*outputSuperuser; > > int sequence_data; /* dump sequence data even in schema-only mode */ > + int do_nothing; > } DumpOptions; > > The new structure member appears out of

Re: ON CONFLICT DO NOTHING on pg_dump

2018-06-16 Thread Dilip Kumar
On Thu, Jun 14, 2018 at 4:09 PM, Surafel Temesgen wrote: > > > 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 @@ -172,6 +172,7 @@ typedef struct _dumpOptions char*outputSuperuser; int sequence_data; /* dump

RE: ON CONFLICT DO NOTHING on pg_dump

2018-06-14 Thread Ideriha, Takeshi
Hi, >-Original Message- >From: Surafel Temesgen [mailto:surafel3...@gmail.com] >thank you for the review > > 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

RE: ON CONFLICT DO NOTHING on pg_dump

2018-06-14 Thread Ideriha, Takeshi
>-Original Message- >From: Nico Williams [mailto:n...@cryptonector.com] >On Tue, Jun 12, 2018 at 09:05:23AM +, Ideriha, Takeshi wrote: >> >From: Surafel Temesgen [mailto:surafel3...@gmail.com] >> >Subject: ON CONFLICT DO NOTHING on pg_dump >> >

Re: ON CONFLICT DO NOTHING on pg_dump

2018-06-14 Thread Surafel Temesgen
On Tue, Jun 12, 2018 at 12:05 PM, Ideriha, Takeshi < ideriha.take...@jp.fujitsu.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

Re: ON CONFLICT DO NOTHING on pg_dump

2018-06-12 Thread Nico Williams
On Tue, Jun 12, 2018 at 09:05:23AM +, Ideriha, Takeshi wrote: > >From: Surafel Temesgen [mailto:surafel3...@gmail.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 a

RE: ON CONFLICT DO NOTHING on pg_dump

2018-06-12 Thread Ideriha, Takeshi
>From: Surafel Temesgen [mailto:surafel3...@gmail.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 comman