Re: [Proposal] Allow pg_dump to include all child tables with the root table - Mailing list pgsql-hackers

From Gilles Darold
Subject Re: [Proposal] Allow pg_dump to include all child tables with the root table
Date
Msg-id 84edf9a5-c59c-2644-1ac8-7ac5b13f2891@migops.com
Whole thread Raw
In response to Re: [Proposal] Allow pg_dump to include all child tables with the root table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Deduplicate logicalrep_read_tuple()
Next
From: "Joel Jacobson"
Date:
Subject: Re: Missing free_var() at end of accum_sum_final()?