Re: Refactoring pg_dump's getTables()

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Refactoring pg_dump's getTables()
Date: 2021-10-19 13:12:43
Message-ID: E4670DDB-2C63-4700-A87A-F83CF9D810B7@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 17 Oct 2021, at 22:05, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> 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 query.
>> This gets rid of nearly 300 lines of duplicative spaghetti code,
>> creates a uniform style for dealing with cross-version changes
>> (replacing at least three different methods currently being used
>> for that in this same stretch of code), and allows moving some
>> comments to be closer to the code they describe.
>
> Yeah, this seems a lot better than the original coding.

+1

> 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 way for
readability.

--
Daniel Gustafsson https://vmware.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2021-10-19 13:14:59 pgstat_assert_is_up() can fail in walsender
Previous Message Nitin Jadhav 2021-10-19 13:07:53 Re: when the startup process doesn't (logging startup delays)