Le 04/03/2023 à 19:18, Tom Lane a écrit :
> Gilles Darold <gilles@migops.com> writes:
>> But I disagree the use of --table-with-childs and
>> --exclude-table-with-childs because we already have the --table and
>> --exclude-table, and it will add lot of code where we just need a switch
>> to include children tables.
> I quite dislike the idea of a separate --with-whatever switch, because
> it will (presumably) apply to all of your --table and --exclude-table
> switches, where you may need it to apply to just some of them.
> Spelling considerations aside, attaching the property to the
> individual switches seems far superior. And I neither believe that
> this would add a lot of code, nor accept that as an excuse even if
> it's true.y..
Right, this is not a lot of code but just more code where I think we
just need a switch. I much prefer that it applies to all --table /
--exclude-table because this is generally the behavior we want for all
root/parent tables. But I agree that in some cases users could want that
this behavior applies to some selected tables only so the proposed new
options can answer to this need. Even if generally in similar cases
several pg_dump commands can be used. This is just my opinion, I will
adapt the patch to use the proposed new options.
But, what do you think about having pg_dump default to dump children
tables with --table / --exclude-table? I was very surprised that this
was not the case the first time I see that. In this case we could add
--[exclude-]table-no-child-tables. I think this form will be less used
than the form where we need the child tables to be dump with the parent
table, meaning that most of the time pg_dump commands using --table and
--exclude-table will be kept untouched and those using more regexp to
dump child tables could be simplified. I'm not sure that the backward
compatibility is an argument here to not change the default behavior of
pg_dump.
--
Gilles
--
Gilles Darold