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

From Fabien COELHO
Subject Re: pg_dump multi VALUES INSERT
Date
Msg-id alpine.DEB.2.21.1902030841060.18649@lancre
Whole thread Raw
In response to Re: pg_dump multi VALUES INSERT  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: pg_dump multi VALUES INSERT  (David Rowley <david.rowley@2ndquadrant.com>)
Re: pg_dump multi VALUES INSERT  (Surafel Temesgen <surafel3000@gmail.com>)
List pgsql-hackers
Hello David,

>> I do not understand why dump_inserts declaration has left the "flags for
>> options" section.
>
> I moved that because it's no longer just a flag. It now stores an int value.

Hmmm. Indeed, all th "int"s of this section should be "bool" instead. Now, 
some "flags" do not appear although the culd (clear, createdb, blobs), so 
the logic is kinda fuzzy anyway. Do as you wish.

>> I'd suggest not to rely on "atoi" because it does not check the argument
>> syntax, so basically anything is accepted, eg "1O" is 1;
>
> Seems like it's good enough for --jobs and --compress.   Do you think
> those should be changed too? or what's the reason to hold
> --rows-per-insert to a different standard?

I think that there is a case for avoiding sloppy "good enough" programming 
practices:-) Alas, as you point out, "atoi" is widely used. I'm campaining 
to avoid adding more of them. There has been some push to actually remove 
"atoi" when not appropriate, eg from "libpq". I'd suggest to consider 
starting doing the right thing, and left fixing old patterns to another 
patch.

>> There is a test, that is good! Charater "." should be backslashed in the
>> regexpr.
>
> Yeah, you're right.   I wonder if we should fix the test of them in
> another patch.

From a software engineering perspective, I'd say that a feature and its 
tests really belong to the same patch.

-- 
Fabien.


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance
Next
From: Noah Misch
Date:
Subject: Re: Synchronize with imath upstream