Re: pg_dump multi VALUES INSERT - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: pg_dump multi VALUES INSERT
Date
Msg-id CAKFQuwbEQpOeo3yimRDZS9q1ZmkkD5yvjGP_fCbz4LHrfRow8g@mail.gmail.com
Whole thread Raw
In response to Re: pg_dump multi VALUES INSERT  (Surafel Temesgen <surafel3000@gmail.com>)
List pgsql-hackers
On Fri, Jan 18, 2019 at 5:02 AM Surafel Temesgen <surafel3000@gmail.com> wrote:
> On Fri, Jan 18, 2019 at 2:29 PM David Rowley <david.rowley@2ndquadrant.com> wrote:
>>
>> On Fri, 18 Jan 2019 at 19:29, Surafel Temesgen <surafel3000@gmail.com> wrote:
>> > this happen because i don't disallow the usage of --inserts  and --rows-per-insert
>> > option together.it should be error out in those case.i correct it in attached patch
>>
>> I don't think it should be an error. It's not like the two options
>> conflict. I imagined that you'd need to specify you want --inserts and
>> optionally could control how many rows per statement that would be put
>> in those commands. I'd be surprised to be confronted with an error for
>> asking for that.
>>
>
> if you specified --inserts option you already specified the number of rows per statement which is 1 .
> if more than one rows per statement needed it must be specified using --rows-per-insert
> and specifying one row per statement using --inserts option at the same time specify
> different number of rows per statement with --rows-per-insert option seems conflicting to me.

So, the other way of looking at it - why do we even need an entirely
new option.  Modify --inserts to accept an optional integer value that
defaults to 1 (I'm not sure how tricky dealing with optional option
values is though...).

--inserts-columns implies --inserts but if you want to change the
number of rows you need to specify both (or add the same optional
integer to --inserts-columns)

David J.


pgsql-hackers by date:

Previous
From: Rahila Syed
Date:
Subject: Re: monitoring CREATE INDEX [CONCURRENTLY]
Next
From: "David G. Johnston"
Date:
Subject: Re: pg_dump multi VALUES INSERT