diff options
author | Michael Paquier <michael@paquier.xyz> | 2020-06-11 15:48:46 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2020-06-11 15:48:46 +0900 |
commit | a3b2bf1fe7ce7cf88af6af2c100c6ed61c976780 (patch) | |
tree | 0c9d7cfa4b43b461aaddad0b5c37adfe1be8dfe6 | |
parent | c4325cefba512772efc108baf8ef7182c3833716 (diff) | |
download | postgresql-a3b2bf1fe7ce7cf88af6af2c100c6ed61c976780.tar.gz postgresql-a3b2bf1fe7ce7cf88af6af2c100c6ed61c976780.zip |
Move frontend-side archive APIs from src/common/ to src/fe_utils/
fe_archive.c was compiled only for the frontend in src/common/, but as
it will never share anything with the backend, it makes most sense to
move this file to src/fe_utils/.
Reported-by: Peter Eisentraut
Discussion: https://postgr.es/m/e9766d71-8655-ac86-bdf6-77e0e7169977@2ndquadrant.com
Backpatch-through: 13
-rw-r--r-- | src/bin/pg_rewind/parsexlog.c | 2 | ||||
-rw-r--r-- | src/common/Makefile | 1 | ||||
-rw-r--r-- | src/fe_utils/Makefile | 1 | ||||
-rw-r--r-- | src/fe_utils/archive.c (renamed from src/common/fe_archive.c) | 10 | ||||
-rw-r--r-- | src/include/fe_utils/archive.h (renamed from src/include/common/fe_archive.h) | 4 | ||||
-rw-r--r-- | src/tools/msvc/Mkvcbuild.pm | 8 |
6 files changed, 11 insertions, 15 deletions
diff --git a/src/bin/pg_rewind/parsexlog.c b/src/bin/pg_rewind/parsexlog.c index d637f5eb771..bc6f9769941 100644 --- a/src/bin/pg_rewind/parsexlog.c +++ b/src/bin/pg_rewind/parsexlog.c @@ -19,7 +19,7 @@ #include "catalog/pg_control.h" #include "catalog/storage_xlog.h" #include "commands/dbcommands_xlog.h" -#include "common/fe_archive.h" +#include "fe_utils/archive.h" #include "filemap.h" #include "pg_rewind.h" diff --git a/src/common/Makefile b/src/common/Makefile index d0be882cca4..16619e4ba88 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -89,7 +89,6 @@ endif # (Mkvcbuild.pm has a copy of this list, too) OBJS_FRONTEND = \ $(OBJS_COMMON) \ - fe_archive.o \ fe_memutils.o \ file_utils.o \ logging.o \ diff --git a/src/fe_utils/Makefile b/src/fe_utils/Makefile index 9eb4417690b..dd206636047 100644 --- a/src/fe_utils/Makefile +++ b/src/fe_utils/Makefile @@ -20,6 +20,7 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) OBJS = \ + archive.o \ cancel.o \ conditional.o \ mbprint.o \ diff --git a/src/common/fe_archive.c b/src/fe_utils/archive.c index b0d68870db8..c4cb2131985 100644 --- a/src/common/fe_archive.c +++ b/src/fe_utils/archive.c @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------- * - * fe_archive.c + * archive.c * Routines to access WAL archives from frontend * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group @@ -8,15 +8,11 @@ * * * IDENTIFICATION - * src/common/fe_archive.c + * src/fe_utils/archive.c * *------------------------------------------------------------------------- */ -#ifndef FRONTEND -#error "This file is not expected to be compiled for backend code" -#endif - #include "postgres_fe.h" #include <unistd.h> @@ -24,8 +20,8 @@ #include "access/xlog_internal.h" #include "common/archive.h" -#include "common/fe_archive.h" #include "common/logging.h" +#include "fe_utils/archive.h" /* diff --git a/src/include/common/fe_archive.h b/src/include/fe_utils/archive.h index 495b560d245..a6beaf04ea7 100644 --- a/src/include/common/fe_archive.h +++ b/src/include/fe_utils/archive.h @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * fe_archive.h + * archive.h * Routines to access WAL archives from frontend * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * src/include/common/fe_archive.h + * src/include/fe_utils/archive.h * *------------------------------------------------------------------------- */ diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index c21c94dc1f7..20da7985c10 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -138,14 +138,14 @@ sub mkvcbuild } our @pgcommonfrontendfiles = ( - @pgcommonallfiles, qw(fe_archive.c fe_memutils.c - file_utils.c logging.c restricted_token.c)); + @pgcommonallfiles, qw(fe_memutils.c file_utils.c + logging.c restricted_token.c)); our @pgcommonbkndfiles = @pgcommonallfiles; our @pgfeutilsfiles = qw( - cancel.c conditional.c mbprint.c print.c psqlscan.l psqlscan.c - simple_list.c string_utils.c recovery_gen.c); + archive.c cancel.c conditional.c mbprint.c print.c psqlscan.l + psqlscan.c simple_list.c string_utils.c recovery_gen.c); $libpgport = $solution->AddProject('libpgport', 'lib', 'misc'); $libpgport->AddDefine('FRONTEND'); |