Re: pg_dump multi VALUES INSERT

From: Surafel Temesgen <surafel3000(at)gmail(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, 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: 2019-02-13 06:36:46
Message-ID: CALAY4q_4zAyum91dOZGvZmhpJR_s3hyO4wYAvERwh_K5kC4jsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 11, 2019 at 10:20 AM David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
wrote:

> Reviewing pg_dump-rows-per-insert-option-v14.
>
Also, maybe one for Fabien (because he seems keen on keeping the
> --rows-per-insert validation code)
>
> strtol() returns a long. dump_inserts is an int, so on machines where
> sizeof(long) == 8 and sizeof(int) == 4 (most machines, these days) the
> validation is not bulletproof. This could lead to:
>
> $ pg_dump --rows-per-insert=2147483648
> pg_dump: rows-per-insert must be a positive number
>

fixed

> For me, I was fine with the atoi() code that the other options use,
> but maybe Fabien has a problem with the long vs int?
>

The main issue with atoi() is it does not detect errors and return 0 for
both invalid input and input value 0 but in our case it doesn't case a
problem because it error out for value 0. but for example in compress Level
if invalid input supplied it silently precede as input value 0 is supplied.

regards
Surafel

Attachment Content-Type Size
pg_dump-rows-per-insert-option-v15.patch text/x-patch 15.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-02-13 07:06:17 Re: reducing isolation tests runtime
Previous Message Kyotaro HORIGUCHI 2019-02-13 06:31:14 Re: Protect syscache from bloating with negative cache entries