Re: pg_dump multi VALUES INSERT

From: Surafel Temesgen <surafel3000(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump multi VALUES INSERT
Date: 2018-12-28 14:57:23
Message-ID: CALAY4q-B1uFAe9k12Lcm=ADr+t51M2eYrV77C_3igm2TS-1+Xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 25, 2018 at 2:47 PM Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:

Thank you for looking into it

>
> Hello Surafel,
>
> > Thank you for informing, Here is an updated patch against current master
>
> Patch applies cleanly, compiles, "make check" is okay, but given that the
> feature is not tested...
>
> Feature should be tested somewhere.
>
> ISTM that command-line switches with optional arguments should be avoided:
> This feature is seldom used (hmmm... 2 existing instances), because it
> interferes with argument processing if such switches are used as the last
> one. It is only okay with commands which do not expect arguments. For
> backward compatibility, this suggests to add another switch, eg
> --insert-multi=100 or whatever, which would possibly default to 100. The
> alternative is to break compatibility with adding a mandatory argument,
> but I guess it would not be admissible to committers.
>
> Function "atoi" parses "1zzz" as 1, which is debatable, so I'd suggest to
> avoid it and use some stricter option and error out on malformed integers.
>
> The --help output does not document the --inserts argument, nor the
> documentation.
>
>
done

There is an indendation issue within the while loop.
>
> Given that the implementation is largely a copy-paste of the preceding
> function, I'd suggest to simply extend it so that it takes into account
> the "multi insert" setting and default to the previous behavior if not
> set.

At first i also try to do it like that but it seems the function will
became long and more complex to me

Regards

Surafel

Attachment Content-Type Size
multi_values_inserts_dum_v5.patch text/x-patch 10.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-12-28 15:16:07 Re: Poor buildfarm coverage of strong-random alternatives
Previous Message Fabien COELHO 2018-12-28 14:50:55 Re: Offline enabling/disabling of data checksums