Re: multi-install PostgresNode fails with older postgres versions - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: multi-install PostgresNode fails with older postgres versions
Date
Msg-id 5ce5a6f9-6932-a794-c26a-112a538211a0@dunslane.net
Whole thread Raw
In response to Re: multi-install PostgresNode fails with older postgres versions  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: multi-install PostgresNode fails with older postgres versions  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On 4/7/21 3:09 PM, Alvaro Herrera wrote:
> On 2021-Apr-07, Andrew Dunstan wrote:
>
>> Aren't you likely to end up duplicating substantial amounts of code,
>> though?
> No — did you look at his code?  Each version is child of the one just
> above, so you only need to override things where behavior changes from
> one version to the next.
>

yes


>> I'm certainly not at the stage where I think the version-aware
>> code is creating too much clutter. The "forest of conditionals" seems
>> more like a small thicket.
> After comparing both approaches, I think ioguix's is superior in
> cleanliness.
>

a) I'm not mad keen on having oodles of little classes. I should point
out that this will have to traverse possibly the whole hierarchy of
classes at each call to get the the actual method, which is not very
efficient. But to some extent this is a matter of taste. OTOH

b) as it stands pgaTester.pm can't be used for multiple versions in a
single program, which is a design goal here - it sets the single class
to invoke in its BEGIN block. At the very least we would need to replace
that with code which would require the relevant class as needed.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: buildfarm instance bichir stuck
Next
From: Tom Lane
Date:
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?