Thread: pg_basebackup against older server versions

pg_basebackup against older server versions

From
Devrim Gündüz
Date:
Hi,

Apologies if this has been discussed before: When I run pg_basebackup in git
head against v11 server, it treats v11 as v12: Does not create recovery.conf,
adds recovery parameters to postgresql.auto.conf, and also creates
standby.signal file. Is this expected, or a bug?

Regards,
--
Devrim Gündüz
Open Source Solution Architect, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

Attachment

Re: pg_basebackup against older server versions

From
Michael Paquier
Date:
On Wed, Mar 06, 2019 at 11:55:12AM +0300, Devrim Gündüz wrote:
> Apologies if this has been discussed before: When I run pg_basebackup in git
> head against v11 server, it treats v11 as v12: Does not create recovery.conf,
> adds recovery parameters to postgresql.auto.conf, and also creates
> standby.signal file. Is this expected, or a bug?

You are right, this is a bug.  Compatibility with past server versions
should be preserved, and we made an effort to do so in the past (see
the switch to pg_wal/ for example).  Fortunately, maintaining the
compatibility is simple enough as the connection information is close
by so that we just need to change postgresql.auto.conf to
recovery.conf, and avoid the creation of standby.signal.
--
Michael

Attachment

Re: pg_basebackup against older server versions

From
Sergei Kornilov
Date:
Hello

My fault. I thought pg_basebackup works only with same major version, sorry.
How about attached patch?

regards, Sergei
Attachment

Re: pg_basebackup against older server versions

From
Michael Paquier
Date:
On Wed, Mar 06, 2019 at 01:42:16PM +0300, Sergei Kornilov wrote:
> My fault. I thought pg_basebackup works only with same major version, sorry.
> How about attached patch?

No problem.  Thanks for the patch, the logic looks good and I made
some adjustments as attached.  Does that look fine to you?
--
Michael

Attachment

Re: pg_basebackup against older server versions

From
Sergei Kornilov
Date:
Hi

> No problem. Thanks for the patch, the logic looks good and I made
> some adjustments as attached. Does that look fine to you?

Looks fine, thanks. I tested against HEAD and v11.2 with and without -R in both plain and tar formats.

regards, Sergei


Re: pg_basebackup against older server versions

From
Michael Paquier
Date:
On Thu, Mar 07, 2019 at 10:57:46AM +0300, Sergei Kornilov wrote:
> Looks fine, thanks. I tested against HEAD and v11.2 with and without
> -R in both plain and tar formats.

Same here, so I have committed the patch.
--
Michael

Attachment