Re: Refactoring pg_dump's getTables()

2021-10-19 Thread Tom Lane
Daniel Gustafsson writes: > On 17 Oct 2021, at 22:05, Alvaro Herrera wrote: >> Maybe I would group together the changes that all require the same version >> test, rather than keeping the output columns in the same order. > I agree with that, if we're doing all this we might as well go all the wa

Re: Refactoring pg_dump's getTables()

2021-10-19 Thread Tom Lane
Daniel Gustafsson writes: > On 17 Oct 2021, at 22:05, Alvaro Herrera wrote: >> Maybe I would group together the changes that all require the same version >> test, rather than keeping the output columns in the same order. > I agree with that, if we're doing all this we might as well go all the wa

Re: Refactoring pg_dump's getTables()

2021-10-19 Thread Daniel Gustafsson
> On 17 Oct 2021, at 22:05, Alvaro Herrera wrote: > > On 2021-Oct-16, Tom Lane wrote: > >> Attached is a proposed patch that refactors getTables() along the >> same lines as some previous work (eg 047329624, ed2c7f65b, daa9fe8a5) >> to avoid having multiple partially-redundant copies of the SQL

Re: Refactoring pg_dump's getTables()

2021-10-17 Thread Tom Lane
Alvaro Herrera writes: > Yeah, this seems a lot better than the original coding. Maybe I would > group together the changes that all require the same version test, > rather than keeping the output columns in the same order. This reduces > the number of branches. Because the follow-on code uses

Re: Refactoring pg_dump's getTables()

2021-10-17 Thread Alvaro Herrera
On 2021-Oct-16, Tom Lane wrote: > Attached is a proposed patch that refactors getTables() along the > same lines as some previous work (eg 047329624, ed2c7f65b, daa9fe8a5) > to avoid having multiple partially-redundant copies of the SQL query. > This gets rid of nearly 300 lines of duplicative spa