Re: pgsql: Allow extensions to add new backup targets. - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Allow extensions to add new backup targets.
Date
Msg-id YjGvq4zPDT6j15go@paquier.xyz
Whole thread Raw
In response to pgsql: Allow extensions to add new backup targets.  (Robert Haas <rhaas@postgresql.org>)
Responses Re: pgsql: Allow extensions to add new backup targets.
List pgsql-committers
Hi Robert,

On Tue, Mar 15, 2022 at 05:33:12PM +0000, Robert Haas wrote:
> Allow extensions to add new backup targets.
>
> Commit 3500ccc39b0dadd1068a03938e4b8ff562587ccc allowed for base backup
> targets, meaning that we could do something with the backup other than
> send it to the client, but all of those targets had to be baked in to
> the core code. This commit makes it possible for extensions to define
> additional backup targets.

I have noticed that this commit produces a warning when building with
MSVC, as of the end of BaseBackupGetTargetHandle() when the target
cannot be found.  I guess that you'd better add a fake return NULL to
keep such compilers quiet about that, like that:
+++ b/src/backend/replication/basebackup_target.c
@@ -144,6 +144,9 @@ BaseBackupGetTargetHandle(char *target, char *target_detail)
    ereport(ERROR,
            (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
             errmsg("unrecognized target: \"%s\"", target)));
+
+   /* keep compiler quiet */
+   return NULL;
 }

Thanks,
--
Michael

Attachment

pgsql-committers by date:

Previous
From: Alexander Korotkov
Date:
Subject: pgsql: Fix default signature length for gist_ltree_ops
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: doc: Ensure intermediate path creation with mkdir