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

From Alvaro Herrera
Subject Re: multi-install PostgresNode fails with older postgres versions
Date
Msg-id 20210407173631.GA10557@alvherre.pgsql
Whole thread Raw
In response to Re: multi-install PostgresNode fails with older postgres versions  (Jehan-Guillaume de Rorthais <jgdr@dalibo.com>)
Responses Re: multi-install PostgresNode fails with older postgres versions
Re: multi-install PostgresNode fails with older postgres versions
List pgsql-hackers
On 2021-Apr-07, Jehan-Guillaume de Rorthais wrote:

> Yes, it would be much saner to make PostgresNode the factory class. Plus, some
> more logic could be injected there to either auto-detect the version (current
> behavior) or eg. use a given path to the binaries as Mark did in its patch.

I'm not sure what you mean about auto-detecting the version -- I assume
we would auto-detect the version by calling pg_config from the
configured path and parsing the binary, which is what Mark's patch is
supposed to do already.  So I don't see what the distinction between
those two things is.

In order to avoid having an ever-growing plethora of 100-byte .pm files,
we can put the version-specific classes in the same PostgresNode.pm
file, at the bottom, "class PostgresNode96; use parent PostgresNode10;"
followed by the routines that are overridden for each version.

> Let me know if it worth that I work on an official patch.

Let's give it a try ...

-- 
Álvaro Herrera       Valdivia, Chile



pgsql-hackers by date:

Previous
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: multi-install PostgresNode fails with older postgres versions
Next
From: Andrew Dunstan
Date:
Subject: Re: multi-install PostgresNode fails with older postgres versions