From 1b645be65e36cfda84316aa172a1198914f398c3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 20 Feb 2008 22:46:24 +0000 Subject: [PATCH] Rename miscadmin.h's PG_VERSIONSTR macro to PG_BACKEND_VERSIONSTR to make it a bit clearer what it is, and get rid of duplicate definitions in initdb and pg_ctl. --- src/backend/postmaster/postmaster.c | 2 +- src/bin/initdb/initdb.c | 5 +---- src/bin/pg_ctl/pg_ctl.c | 10 ++++------ src/include/miscadmin.h | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index e4da6455d2..585881883a 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -665,7 +665,7 @@ PostmasterMain(int argc, char *argv[]) #ifdef EXEC_BACKEND /* Locate executable backend before we change working directory */ - if (find_other_exec(argv[0], "postgres", PG_VERSIONSTR, + if (find_other_exec(argv[0], "postgres", PG_BACKEND_VERSIONSTR, postgres_exec_path) < 0) ereport(FATAL, (errmsg("%s: could not locate matching postgres executable", diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 4641330e79..c752e29d36 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -67,9 +67,6 @@ int optreset; #endif -/* version string we expect back from postgres */ -#define PG_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" - /* * these values are passed in by makefile defines */ @@ -2666,7 +2663,7 @@ main(int argc, char *argv[]) sprintf(pgdenv, "PGDATA=%s", pg_data); putenv(pgdenv); - if ((ret = find_other_exec(argv[0], "postgres", PG_VERSIONSTR, + if ((ret = find_other_exec(argv[0], "postgres", PG_BACKEND_VERSIONSTR, backend_exec)) < 0) { char full_path[MAXPGPATH]; diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index b0aefc5a03..b7314c3876 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -33,6 +33,7 @@ #include "libpq/pqsignal.h" #include "getopt_long.h" +#include "miscadmin.h" #if defined(__CYGWIN__) #include @@ -49,10 +50,6 @@ int optreset; typedef long pgpid_t; -/* postgres version ident string */ -#define PM_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" - - typedef enum { SMART_MODE, @@ -659,7 +656,7 @@ do_start(void) postmaster_path = pg_malloc(MAXPGPATH); - if ((ret = find_other_exec(argv0, "postgres", PM_VERSIONSTR, + if ((ret = find_other_exec(argv0, "postgres", PG_BACKEND_VERSIONSTR, postmaster_path)) < 0) { char full_path[MAXPGPATH]; @@ -1020,7 +1017,8 @@ pgwin32_CommandLine(bool registration) } else { - ret = find_other_exec(argv0, "postgres", PM_VERSIONSTR, cmdLine); + ret = find_other_exec(argv0, "postgres", PG_BACKEND_VERSIONSTR, + cmdLine); if (ret != 0) { write_stderr(_("%s: could not find postgres program executable\n"), progname); diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 9c848305e1..d0a1520648 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -26,7 +26,7 @@ #include "pgtime.h" /* for pg_time_t */ -#define PG_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" +#define PG_BACKEND_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" /***************************************************************************** -- 2.39.5