Re: multi-install PostgresNode fails with older postgres versions

2021-05-21 Thread Andrew Dunstan
On 5/20/21 11:04 PM, Tom Lane wrote: > Andrew Dunstan writes: >> On 5/20/21 9:49 PM, Michael Paquier wrote: >>> Are older versions of the perl MSI that activestate provides hard to >>> come by? FWIW, I would not mind if this README and the docs are >>> updated to mention that on Windows we

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Amit Kapila
On Thu, May 20, 2021 at 5:55 PM Andrew Dunstan wrote: > > On 5/20/21 7:15 AM, Michael Paquier wrote: > > On Thu, May 20, 2021 at 07:05:05AM -0400, Andrew Dunstan wrote: > >> Your version of perl is apparently too old for this. Looks like that > >> needs to be 5.22 or later:

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Tom Lane
Andrew Dunstan writes: > On 5/20/21 9:49 PM, Michael Paquier wrote: >> Are older versions of the perl MSI that activestate provides hard to >> come by? FWIW, I would not mind if this README and the docs are >> updated to mention that on Windows we require a newer version for this >> set of MSIs.

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Andrew Dunstan
On 5/20/21 9:49 PM, Michael Paquier wrote: > On Thu, May 20, 2021 at 08:25:45AM -0400, Andrew Dunstan wrote: >> 5.8 is ancient. Yes I know it's what's in the Msys1 DTK, but the DTK >> perl seems happy with the list form of pipe open - it's only native >> windows perl's that aren't. > Respect to

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Michael Paquier
On Thu, May 20, 2021 at 08:25:45AM -0400, Andrew Dunstan wrote: > 5.8 is ancient. Yes I know it's what's in the Msys1 DTK, but the DTK > perl seems happy with the list form of pipe open - it's only native > windows perl's that aren't. Respect to the Msys1 DTK for that. > Maybe it's time to

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Andrew Dunstan
On 5/20/21 9:53 AM, Tom Lane wrote: > Michael Paquier writes: >> On Thu, May 20, 2021 at 07:05:05AM -0400, Andrew Dunstan wrote: >>> Your version of perl is apparently too old for this. Looks like that >>> needs to be 5.22 or later: >> Hmm.

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Tom Lane
Michael Paquier writes: > On Thu, May 20, 2021 at 07:05:05AM -0400, Andrew Dunstan wrote: >> Your version of perl is apparently too old for this. Looks like that >> needs to be 5.22 or later: > Hmm. src/test/perl/README tells about 5.8.0. That's quite a

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Andrew Dunstan
On 5/20/21 7:15 AM, Michael Paquier wrote: > On Thu, May 20, 2021 at 07:05:05AM -0400, Andrew Dunstan wrote: >> Your version of perl is apparently too old for this. Looks like that >> needs to be 5.22 or later: > Hmm. src/test/perl/README tells about

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Amit Kapila
On Thu, May 20, 2021 at 4:43 PM Andrew Dunstan wrote: > > On 5/20/21 7:05 AM, Andrew Dunstan wrote: > >> > > Your version of perl is apparently too old for this. Looks like that > > needs to be 5.22 or later: > > > > > > However, we could probably rewrite

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Michael Paquier
On Thu, May 20, 2021 at 07:05:05AM -0400, Andrew Dunstan wrote: > Your version of perl is apparently too old for this. Looks like that > needs to be 5.22 or later: Hmm. src/test/perl/README tells about 5.8.0. That's quite a jump. -- Michael

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Andrew Dunstan
On 5/20/21 7:05 AM, Andrew Dunstan wrote: > On 5/20/21 4:36 AM, Amit Kapila wrote: >> On Thu, Apr 22, 2021 at 8:43 PM Andrew Dunstan wrote: >>> On 4/22/21 2:52 AM, Michael Paquier wrote: On Wed, Apr 21, 2021 at 10:04:40AM -0400, Andrew Dunstan wrote: > Here's a patch with these things

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Andrew Dunstan
On 5/20/21 4:36 AM, Amit Kapila wrote: > On Thu, Apr 22, 2021 at 8:43 PM Andrew Dunstan wrote: >> On 4/22/21 2:52 AM, Michael Paquier wrote: >>> On Wed, Apr 21, 2021 at 10:04:40AM -0400, Andrew Dunstan wrote: Here's a patch with these things attended to. >>> Thanks. Reading through it,

Re: multi-install PostgresNode fails with older postgres versions

2021-05-20 Thread Amit Kapila
On Thu, Apr 22, 2021 at 8:43 PM Andrew Dunstan wrote: > > On 4/22/21 2:52 AM, Michael Paquier wrote: > > On Wed, Apr 21, 2021 at 10:04:40AM -0400, Andrew Dunstan wrote: > >> Here's a patch with these things attended to. > > Thanks. Reading through it, that seems pretty much fine to me. I > >

Re: multi-install PostgresNode fails with older postgres versions

2021-04-24 Thread Andrew Dunstan
On 4/24/21 1:54 AM, Michael Paquier wrote: > On Fri, Apr 23, 2021 at 08:10:01AM -0400, Andrew Dunstan wrote: >> Yeah, I think it's ok for comparison purposes just to lump them all >> together. Here's a patch that does that and some consequent cleanup. >> Note we now cache the string rather than

Re: multi-install PostgresNode fails with older postgres versions

2021-04-23 Thread Michael Paquier
On Fri, Apr 23, 2021 at 08:10:01AM -0400, Andrew Dunstan wrote: > Yeah, I think it's ok for comparison purposes just to lump them all > together. Here's a patch that does that and some consequent cleanup. > Note we now cache the string rather than trying to reconstruct it. No objections from here

Re: multi-install PostgresNode fails with older postgres versions

2021-04-23 Thread Andrew Dunstan
On 4/23/21 12:41 AM, Michael Paquier wrote: > On Thu, Apr 22, 2021 at 08:43:10PM -0400, Andrew Dunstan wrote: >> Interesting point. Maybe we need to do something like devel = -4, alpha >> = -3, beta = -2, rc = -1. Or maybe that's overkill. > And after that it would come to how many betas, alphas

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Michael Paquier
On Thu, Apr 22, 2021 at 08:43:10PM -0400, Andrew Dunstan wrote: > Interesting point. Maybe we need to do something like devel = -4, alpha > = -3, beta = -2, rc = -1. Or maybe that's overkill. And after that it would come to how many betas, alphas or RCs you have, but you can never be sure of how

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Andrew Dunstan
On 4/22/21 5:08 PM, Michael Paquier wrote: > On Thu, Apr 22, 2021 at 02:35:13PM -0400, Alvaro Herrera wrote: >> WFM, thanks :-) > Also, do we need to worry about beta releases? Just recalled that > now. Interesting point. Maybe we need to do something like devel = -4, alpha = -3, beta = -2,

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Michael Paquier
On Thu, Apr 22, 2021 at 02:35:13PM -0400, Alvaro Herrera wrote: > WFM, thanks :-) Also, do we need to worry about beta releases? Just recalled that now. -- Michael signature.asc Description: PGP signature

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Alvaro Herrera
On 2021-Apr-22, Andrew Dunstan wrote: >     # Accept standard formats, in case caller has handed us the > output of a >     # postgres command line tool >     my $devel; >     ($arg,$devel) = ($1, $2) >       if ($arg =~  m/^(?:\(?PostgreSQL\)? )?(\d+(?:\.\d+)*)(devel)?/);

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Andrew Dunstan
On 4/22/21 11:09 AM, Alvaro Herrera wrote: > On 2021-Apr-21, Andrew Dunstan wrote: > >> +=head1 DESCRIPTION >> + >> +PostgresVersion encapsulated Postgres version numbers, providing parsing >> +of common version formats and comparison operations. > Small typo here: should be "encapsulates" > >>

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Andrew Dunstan
On 4/22/21 11:46 AM, Mark Dilger wrote: > >> On Apr 22, 2021, at 8:09 AM, Alvaro Herrera wrote: >> >>> + # Accept standard formats, in case caller has handed us the output of a >>> + # postgres command line tool >>> + $arg = $1 >>> + if ($arg =~ m/\(?PostgreSQL\)?

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Mark Dilger
> On Apr 22, 2021, at 8:09 AM, Alvaro Herrera wrote: > >> >> +# Accept standard formats, in case caller has handed us the output of a >> +# postgres command line tool >> +$arg = $1 >> +if ($arg =~ m/\(?PostgreSQL\)? (\d+(?:\.\d+)*(?:devel)?)/); >> + >> +# Split

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Andrew Dunstan
On 4/22/21 2:52 AM, Michael Paquier wrote: > On Wed, Apr 21, 2021 at 10:04:40AM -0400, Andrew Dunstan wrote: >> Here's a patch with these things attended to. > Thanks. Reading through it, that seems pretty much fine to me. I > have not spent time checking _version_cmp in details though :)

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Alvaro Herrera
On 2021-Apr-21, Andrew Dunstan wrote: > +=head1 DESCRIPTION > + > +PostgresVersion encapsulated Postgres version numbers, providing parsing > +of common version formats and comparison operations. Small typo here: should be "encapsulates" > + # Accept standard formats, in case caller has

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Andrew Dunstan
On 4/22/21 2:52 AM, Michael Paquier wrote: > On Wed, Apr 21, 2021 at 10:04:40AM -0400, Andrew Dunstan wrote: >> Here's a patch with these things attended to. > Thanks. Reading through it, that seems pretty much fine to me. I > have not spent time checking _version_cmp in details though :)

Re: multi-install PostgresNode fails with older postgres versions

2021-04-22 Thread Michael Paquier
On Wed, Apr 21, 2021 at 10:04:40AM -0400, Andrew Dunstan wrote: > Here's a patch with these things attended to. Thanks. Reading through it, that seems pretty much fine to me. I have not spent time checking _version_cmp in details though :) -- Michael signature.asc Description: PGP signature

Re: multi-install PostgresNode fails with older postgres versions

2021-04-21 Thread Andrew Dunstan
On 4/21/21 1:13 AM, Michael Paquier wrote: > On Tue, Apr 20, 2021 at 01:11:59PM -0400, Andrew Dunstan wrote: >> Here's the patch for that. > Thanks. > >> +# Accept standard formats, in case caller has handed us the output of a >> +# postgres command line tool >> +$arg = $1 >> +

Re: multi-install PostgresNode fails with older postgres versions

2021-04-20 Thread Michael Paquier
On Tue, Apr 20, 2021 at 01:11:59PM -0400, Andrew Dunstan wrote: > Here's the patch for that. Thanks. > + # Accept standard formats, in case caller has handed us the output of a > + # postgres command line tool > + $arg = $1 > + if ($arg =~ m/\(?PostgreSQL\)?

Re: multi-install PostgresNode fails with older postgres versions

2021-04-20 Thread Andrew Dunstan
On 4/19/21 12:37 PM, Andrew Dunstan wrote: > On 4/19/21 10:43 AM, Mark Dilger wrote: >>> On Apr 19, 2021, at 5:11 AM, Andrew Dunstan wrote: >>> >>> I think therefore I'm inclined for now to do nothing for old version >>> compatibility. >> I agree with waiting until the v15 development cycle. >>

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Mark Dilger
> On Apr 19, 2021, at 10:50 AM, Jehan-Guillaume de Rorthais > wrote: > >> The community needs a single shared PostgresNode implementation that can be >> used by scripts which reproduce bugs. > > Which means it could be OK to have a PostgresNode implementation, leaving in > core source-tree,

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Jehan-Guillaume de Rorthais
On Mon, 19 Apr 2021 10:35:39 -0700 Mark Dilger wrote: > > On Apr 19, 2021, at 10:25 AM, Jehan-Guillaume de Rorthais > > wrote: > > > > On Mon, 19 Apr 2021 12:37:08 -0400 > > Andrew Dunstan wrote: > > > >> > >> On 4/19/21 10:43 AM, Mark Dilger wrote: > >>> > On Apr 19, 2021, at

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Mark Dilger
> On Apr 19, 2021, at 10:25 AM, Jehan-Guillaume de Rorthais > wrote: > > On Mon, 19 Apr 2021 12:37:08 -0400 > Andrew Dunstan wrote: > >> >> On 4/19/21 10:43 AM, Mark Dilger wrote: >>> On Apr 19, 2021, at 5:11 AM, Andrew Dunstan wrote: I think therefore I'm inclined for

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Jehan-Guillaume de Rorthais
On Mon, 19 Apr 2021 12:37:08 -0400 Andrew Dunstan wrote: > > On 4/19/21 10:43 AM, Mark Dilger wrote: > > > >> On Apr 19, 2021, at 5:11 AM, Andrew Dunstan wrote: > >> > >> I think therefore I'm inclined for now to do nothing for old version > >> compatibility. > > I agree with waiting until the

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Jehan-Guillaume de Rorthais
On Mon, 19 Apr 2021 07:43:58 -0700 Mark Dilger wrote: > > On Apr 19, 2021, at 5:11 AM, Andrew Dunstan wrote: > > > > I think therefore I'm inclined for now to do nothing for old version > > compatibility. > > I agree with waiting until the v15 development cycle. Agree.

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Andrew Dunstan
On 4/19/21 10:43 AM, Mark Dilger wrote: > >> On Apr 19, 2021, at 5:11 AM, Andrew Dunstan wrote: >> >> I think therefore I'm inclined for now to do nothing for old version >> compatibility. > I agree with waiting until the v15 development cycle. > >> I would commit the fix for the IPC::Run

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Mark Dilger
> On Apr 19, 2021, at 5:11 AM, Andrew Dunstan wrote: > > I think therefore I'm inclined for now to do nothing for old version > compatibility. I agree with waiting until the v15 development cycle. > I would commit the fix for the IPC::Run caching glitch, > and version detection Thank you.

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Andrew Dunstan
On 4/19/21 8:32 AM, Michael Paquier wrote: > On Mon, Apr 19, 2021 at 08:11:01AM -0400, Andrew Dunstan wrote: >> As far as I know, without any compatibility changes the module is fully >> compatible with releases 13 and 12, and with releases 11 and 10 so long >> as you don't want a standby, and

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Michael Paquier
On Mon, Apr 19, 2021 at 08:11:01AM -0400, Andrew Dunstan wrote: > As far as I know, without any compatibility changes the module is fully > compatible with releases 13 and 12, and with releases 11 and 10 so long > as you don't want a standby, and with releases 9.6 and 9.5 if you also > don't want

Re: multi-install PostgresNode fails with older postgres versions

2021-04-19 Thread Andrew Dunstan
On 4/17/21 12:35 PM, Andrew Dunstan wrote: > >> OK, here is more WIP on this item. I have drawn substantially on Mark's >> and Jehan-Guillaime's work, but it doesn't really resemble either, and I >> take full responsibility for it. >> >> The guiding principles have been: >> >> . avoid doing

Re: multi-install PostgresNode fails with older postgres versions

2021-04-17 Thread Andrew Dunstan
On 4/17/21 12:31 PM, Andrew Dunstan wrote: > On 4/12/21 10:57 AM, Jehan-Guillaume de Rorthais wrote: >> On Mon, 12 Apr 2021 09:52:24 -0400 >> Andrew Dunstan wrote: >> >>> On 4/12/21 8:59 AM, Jehan-Guillaume de Rorthais wrote: Hi, On Wed, 7 Apr 2021 20:07:41 +0200

Re: multi-install PostgresNode fails with older postgres versions

2021-04-17 Thread Andrew Dunstan
On 4/12/21 10:57 AM, Jehan-Guillaume de Rorthais wrote: > On Mon, 12 Apr 2021 09:52:24 -0400 > Andrew Dunstan wrote: > >> On 4/12/21 8:59 AM, Jehan-Guillaume de Rorthais wrote: >>> Hi, >>> >>> On Wed, 7 Apr 2021 20:07:41 +0200 >>> Jehan-Guillaume de Rorthais wrote: >>> [...] >> Let me

Re: multi-install PostgresNode fails with older postgres versions

2021-04-12 Thread Jehan-Guillaume de Rorthais
On Mon, 12 Apr 2021 09:52:24 -0400 Andrew Dunstan wrote: > On 4/12/21 8:59 AM, Jehan-Guillaume de Rorthais wrote: > > Hi, > > > > On Wed, 7 Apr 2021 20:07:41 +0200 > > Jehan-Guillaume de Rorthais wrote: > > [...] > Let me know if it worth that I work on an official patch. > >>>

Re: multi-install PostgresNode fails with older postgres versions

2021-04-12 Thread Andrew Dunstan
On 4/12/21 8:59 AM, Jehan-Guillaume de Rorthais wrote: > Hi, > > On Wed, 7 Apr 2021 20:07:41 +0200 > Jehan-Guillaume de Rorthais wrote: > [...] Let me know if it worth that I work on an official patch. >>> Let's give it a try ... >> OK > So, as promised, here is my take to port my

Re: multi-install PostgresNode fails with older postgres versions

2021-04-12 Thread Jehan-Guillaume de Rorthais
Hi, On Wed, 7 Apr 2021 20:07:41 +0200 Jehan-Guillaume de Rorthais wrote: [...] > > > Let me know if it worth that I work on an official patch. > > > > Let's give it a try ... > > OK So, as promised, here is my take to port my previous work on PostgreSQL source tree. Make check pass

Re: multi-install PostgresNode fails with older postgres versions

2021-04-11 Thread Andrew Dunstan
On 4/7/21 5:06 PM, Alvaro Herrera wrote: > On 2021-Apr-07, Andrew Dunstan wrote: > >> Oh, you want to roll them all up into one file? That could work. It's a >> bit frowned on by perl purists, but I've done similar (see PGBuild/SCM.pm). > Ah! Yeah, pretty much exactly like that, including the

Re: multi-install PostgresNode fails with older postgres versions

2021-04-08 Thread Mark Dilger
> On Apr 7, 2021, at 8:43 AM, Andrew Dunstan wrote: > > > On 4/7/21 1:03 AM, Mark Dilger wrote: >> The v1 patch supported postgres versions back to 8.4, but v2 pushes that >> back to 8.1. >> >> The version of PostgresNode currently committed relies on IPC::Run in a way >> that is subtly

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Mark Dilger
> On Apr 7, 2021, at 2:04 PM, Alvaro Herrera wrote: > > On 2021-Apr-07, Mark Dilger wrote: > >> It seems we're debating between two designs. In the first, each >> PostgresNode function knows about version limitations and has code >> like: >> >> DoSomething() if

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Alvaro Herrera
On 2021-Apr-07, Andrew Dunstan wrote: > Oh, you want to roll them all up into one file? That could work. It's a > bit frowned on by perl purists, but I've done similar (see PGBuild/SCM.pm). Ah! Yeah, pretty much exactly like that, including the "no critic" flag ... -- Álvaro Herrera

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Alvaro Herrera
On 2021-Apr-07, Mark Dilger wrote: > It seems we're debating between two designs. In the first, each > PostgresNode function knows about version limitations and has code > like: > > DoSomething() if $self->at_least_version("11") Yeah, I didn't like this approach -- it is quite messy. >

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Andrew Dunstan
On 4/7/21 4:48 PM, Mark Dilger wrote: > >> On Apr 7, 2021, at 1:28 PM, Alvaro Herrera wrote: >> >> On 2021-Apr-07, Mark Dilger wrote: >> >>> I was commenting on the design to have the PostgresNode derived >>> subclass hard-coded to return "10" as the version: >>> >>>sub version { return 10

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Mark Dilger
> On Apr 7, 2021, at 1:28 PM, Alvaro Herrera wrote: > > On 2021-Apr-07, Mark Dilger wrote: > >> I was commenting on the design to have the PostgresNode derived >> subclass hard-coded to return "10" as the version: >> >>sub version { return 10 } > > That seems a minor bug rather than a

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Andrew Dunstan
On 4/7/21 4:19 PM, Alvaro Herrera wrote: > On 2021-Apr-07, Andrew Dunstan wrote: > >> 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

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Alvaro Herrera
On 2021-Apr-07, Mark Dilger wrote: > I was commenting on the design to have the PostgresNode derived > subclass hard-coded to return "10" as the version: > > sub version { return 10 } That seems a minor bug rather than a showstopper design deficiency. I agree that hardcoding the version in

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Alvaro Herrera
On 2021-Apr-07, Andrew Dunstan wrote: > 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

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Andrew Dunstan
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

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Mark Dilger
> On Apr 7, 2021, at 12:13 PM, Alvaro Herrera wrote: > > On 2021-Apr-07, Mark Dilger wrote: > >> It's not sufficient to think about postgres versions as "10", "11", >> etc. You have to be able to spin up nodes of any build, like "9.0.7". >> There are specific versions of postgres with

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Alvaro Herrera
On 2021-Apr-07, Mark Dilger wrote: > It's not sufficient to think about postgres versions as "10", "11", > etc. You have to be able to spin up nodes of any build, like "9.0.7". > There are specific versions of postgres with specific bugs that cause > specific problems, and later versions of

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Alvaro Herrera
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. > I'm

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Mark Dilger
> On Apr 7, 2021, at 11:35 AM, Jehan-Guillaume de Rorthais > wrote: > > On Wed, 7 Apr 2021 13:38:39 -0400 > Andrew Dunstan wrote: > >> On 4/7/21 1:19 PM, Jehan-Guillaume de Rorthais wrote: >>> On Wed, 7 Apr 2021 12:51:55 -0400 >>> Alvaro Herrera wrote: >>> On 2021-Apr-07,

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Jehan-Guillaume de Rorthais
On Wed, 7 Apr 2021 13:38:39 -0400 Andrew Dunstan wrote: > On 4/7/21 1:19 PM, Jehan-Guillaume de Rorthais wrote: > > On Wed, 7 Apr 2021 12:51:55 -0400 > > Alvaro Herrera wrote: > > > >> On 2021-Apr-07, Jehan-Guillaume de Rorthais wrote: > >> > >>> When I'm creating a new node, I'm using the

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Jehan-Guillaume de Rorthais
On Wed, 7 Apr 2021 10:50:26 -0700 Mark Dilger wrote: > > On Apr 7, 2021, at 10:36 AM, Alvaro Herrera 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

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Jehan-Guillaume de Rorthais
On Wed, 7 Apr 2021 13:36:31 -0400 Alvaro Herrera wrote: > 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

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Mark Dilger
> On Apr 7, 2021, at 10:36 AM, Alvaro Herrera 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

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Andrew Dunstan
On 4/7/21 1:19 PM, Jehan-Guillaume de Rorthais wrote: > On Wed, 7 Apr 2021 12:51:55 -0400 > Alvaro Herrera wrote: > >> On 2021-Apr-07, Jehan-Guillaume de Rorthais wrote: >> >>> When I'm creating a new node, I'm using the "pgaTester" factory class. It >>> relies on PATH to check the major

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Alvaro Herrera
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

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Jehan-Guillaume de Rorthais
On Wed, 7 Apr 2021 12:51:55 -0400 Alvaro Herrera wrote: > On 2021-Apr-07, Jehan-Guillaume de Rorthais wrote: > > > When I'm creating a new node, I'm using the "pgaTester" factory class. It > > relies on PATH to check the major version using pg_config, then loads the > > appropriate class. >

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Mark Dilger
> On Apr 7, 2021, at 9:26 AM, Jehan-Guillaume de Rorthais > wrote: > > On Wed, 7 Apr 2021 09:08:31 -0700 > Mark Dilger wrote: > >>> On Apr 7, 2021, at 7:37 AM, Jehan-Guillaume de Rorthais > >>> And here is a demo test file: >>>

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Alvaro Herrera
On 2021-Apr-07, Jehan-Guillaume de Rorthais wrote: > When I'm creating a new node, I'm using the "pgaTester" factory class. It > relies on PATH to check the major version using pg_config, then loads the > appropriate class. >From a code cleanliness point of view, I agree that having separate

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Jehan-Guillaume de Rorthais
On Wed, 7 Apr 2021 09:08:31 -0700 Mark Dilger wrote: > > On Apr 7, 2021, at 7:37 AM, Jehan-Guillaume de Rorthais > > And here is a demo test file: > > https://github.com/ioguix/check_pgactivity/blob/tests/t/01-streaming_delta.t > > > > My limited set of tests are working with versions back to

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Jehan-Guillaume de Rorthais
On Wed, 7 Apr 2021 11:54:36 -0400 Andrew Dunstan wrote: > On 4/7/21 10:37 AM, Jehan-Guillaume de Rorthais wrote: > > Hi all, > > > > First, sorry to step in this discussion this late. I didn't noticed it > > before :( > > > > I did some work about these compatibility issues in late 2020 to use >

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Mark Dilger
> On Apr 7, 2021, at 7:37 AM, Jehan-Guillaume de Rorthais > wrote: > > Hi all, > > First, sorry to step in this discussion this late. I didn't noticed it before > :( Not a problem. > I did some work about these compatibility issues in late 2020 to use > PostgresNode in the

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Andrew Dunstan
On 4/7/21 10:37 AM, Jehan-Guillaume de Rorthais wrote: > Hi all, > > First, sorry to step in this discussion this late. I didn't noticed it before > :( > > I did some work about these compatibility issues in late 2020 to use > PostgresNode in the check_pgactivity TAP tests. > > See

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Andrew Dunstan
On 4/7/21 1:03 AM, Mark Dilger wrote: > The v1 patch supported postgres versions back to 8.4, but v2 pushes that back > to 8.1. > > The version of PostgresNode currently committed relies on IPC::Run in a way > that is subtly wrong. The first time IPC::Run::run(X, ...) is called, it > uses

Re: multi-install PostgresNode fails with older postgres versions

2021-04-07 Thread Jehan-Guillaume de Rorthais
Hi all, First, sorry to step in this discussion this late. I didn't noticed it before :( I did some work about these compatibility issues in late 2020 to use PostgresNode in the check_pgactivity TAP tests. See https://github.com/ioguix/check_pgactivity/tree/tests/t/lib PostgresNode.pm,

Re: multi-install PostgresNode fails with older postgres versions

2021-04-06 Thread Mark Dilger
> On Apr 3, 2021, at 11:01 AM, Andrew Dunstan wrote: > > I've had a look at the first of these patches. I think it's generally > ok, but: > > > -TestLib::system_or_bail('initdb', '-D', $pgdata, '-A', 'trust', '-N', > +TestLib::system_or_bail('initdb', '-D', $pgdata, '-A', 'trust', >

Re: multi-install PostgresNode fails with older postgres versions

2021-04-03 Thread Andrew Dunstan
On 3/31/21 10:28 PM, Mark Dilger wrote: > >> On Mar 31, 2021, at 1:07 PM, Mark Dilger >> wrote: >> >> >> >>> On Mar 31, 2021, at 1:05 PM, Andrew Dunstan wrote: >>> >>> >>> On 3/31/21 3:48 PM, Alvaro Herrera wrote: On 2021-Mar-31, Mark Dilger wrote: > PostgresNode::start()

Re: multi-install PostgresNode fails with older postgres versions

2021-03-31 Thread Mark Dilger
> On Mar 31, 2021, at 1:07 PM, Mark Dilger wrote: > > > >> On Mar 31, 2021, at 1:05 PM, Andrew Dunstan wrote: >> >> >> On 3/31/21 3:48 PM, Alvaro Herrera wrote: >>> On 2021-Mar-31, Mark Dilger wrote: >>> PostgresNode::start() doesn't work for servers older than version 10,

Re: multi-install PostgresNode fails with older postgres versions

2021-03-31 Thread Andrew Dunstan
On 3/30/21 8:52 PM, Michael Paquier wrote: > On Tue, Mar 30, 2021 at 08:44:26PM -0400, Andrew Dunstan wrote: >> Yeah, it should be validated. All things considered I think just calling >> 'pg_config --version' is probably the simplest validation, and likely to >> be sufficient. >> >> I'll try to

Re: multi-install PostgresNode fails with older postgres versions

2021-03-31 Thread Mark Dilger
> On Mar 31, 2021, at 1:05 PM, Andrew Dunstan wrote: > > > On 3/31/21 3:48 PM, Alvaro Herrera wrote: >> On 2021-Mar-31, Mark Dilger wrote: >> >>> PostgresNode::start() doesn't work for servers older than version 10, >>> either. If I hack that function to sleep until the postmaster.pid >>>

Re: multi-install PostgresNode fails with older postgres versions

2021-03-31 Thread Andrew Dunstan
On 3/31/21 3:48 PM, Alvaro Herrera wrote: > On 2021-Mar-31, Mark Dilger wrote: > >> PostgresNode::start() doesn't work for servers older than version 10, >> either. If I hack that function to sleep until the postmaster.pid >> file exists, it works, but that is really ugly and is just to prove

Re: multi-install PostgresNode fails with older postgres versions

2021-03-31 Thread Alvaro Herrera
On 2021-Mar-31, Mark Dilger wrote: > PostgresNode::start() doesn't work for servers older than version 10, > either. If I hack that function to sleep until the postmaster.pid > file exists, it works, but that is really ugly and is just to prove to > myself that it is a timing issue. There were

Re: multi-install PostgresNode fails with older postgres versions

2021-03-31 Thread Mark Dilger
> On Mar 30, 2021, at 5:41 PM, Mark Dilger wrote: > > 1) PostgresNode::init() doesn't work for older server versions PostgresNode::start() doesn't work for servers older than version 10, either. If I hack that function to sleep until the postmaster.pid file exists, it works, but that is

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 11:06:55PM -0300, Alvaro Herrera wrote: > On 2021-Mar-31, Michael Paquier wrote: >> There is already TestLib::check_pg_config(). Shouldn't you leverage >> that with PG_VERSION_NUM or equivalent? > > hmm, I wonder if we shouldn't take the stance that it is not TestLib's >

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Alvaro Herrera
On 2021-Mar-31, Michael Paquier wrote: > There is already TestLib::check_pg_config(). Shouldn't you leverage > that with PG_VERSION_NUM or equivalent? hmm, I wonder if we shouldn't take the stance that it is not TestLib's business to be calling any Pg binaries. So that routine should be moved

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 5:52 PM, Michael Paquier wrote: > > On Tue, Mar 30, 2021 at 08:44:26PM -0400, Andrew Dunstan wrote: >> Yeah, it should be validated. All things considered I think just calling >> 'pg_config --version' is probably the simplest validation, and likely to >> be sufficient.

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 08:44:26PM -0400, Andrew Dunstan wrote: > Yeah, it should be validated. All things considered I think just calling > 'pg_config --version' is probably the simplest validation, and likely to > be sufficient. > > I'll try to come up with something tomorrow. There is already

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 5:44 PM, Andrew Dunstan wrote: > > I'll try to come up with something tomorrow. I hope the patch I sent is useful, at least as a starting point. — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Andrew Dunstan
On 3/30/21 6:22 PM, Alvaro Herrera wrote: > On 2021-Mar-30, Mark Dilger wrote: > >> Once you have a node running, you can query the version using >> safe_psql, but that clearly doesn't work soon enough, since we need >> the information prior to running initdb. > I was thinking something like

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 3:22 PM, Alvaro Herrera wrote: > >> One of the things I noticed while playing with this new toy (thanks, >> Andrew!) is that if you pass a completely insane install_path, you >> don't get any errors. In fact, you get executables and libraries from >> whatever

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Alvaro Herrera
On 2021-Mar-30, Mark Dilger wrote: > Once you have a node running, you can query the version using > safe_psql, but that clearly doesn't work soon enough, since we need > the information prior to running initdb. I was thinking something like examining some file in the install dir -- say,

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 3:12 PM, Alvaro Herrera wrote: > > On 2021-Mar-30, Mark Dilger wrote: > >> The problem is clear enough; -N/--nosync was added in 9.3, and >> PostgresNode::init is passing -N to initdb unconditionally. I wonder >> if during PostgresNode::new a call should be made to

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Alvaro Herrera
On 2021-Mar-30, Mark Dilger wrote: > The problem is clear enough; -N/--nosync was added in 9.3, and > PostgresNode::init is passing -N to initdb unconditionally. I wonder > if during PostgresNode::new a call should be made to pg_config and the > version information grep'd out so that version

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 10:39 AM, Mark Dilger > wrote: > > Andrew, > > While developing some cross version tests, I noticed that PostgresNode::init > fails for postgres versions older than 9.3, like so: > > # Checking port 52814 > # Found port 52814 > Name: 9.2.24 > Data directory: >