Rename miscadmin.h's PG_VERSIONSTR macro to PG_BACKEND_VERSIONSTR to
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 20 Feb 2008 22:46:24 +0000 (22:46 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 20 Feb 2008 22:46:24 +0000 (22:46 +0000)
make it a bit clearer what it is, and get rid of duplicate definitions
in initdb and pg_ctl.

src/backend/postmaster/postmaster.c
src/bin/initdb/initdb.c
src/bin/pg_ctl/pg_ctl.c
src/include/miscadmin.h

index e4da6455d23673668b91b0f4400d6e604385c818..585881883a79b33cc69db7168c159201733d6834 100644 (file)
@@ -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",
index 4641330e791d29c72bf8aaf5ce9a1d8b2c82dcdc..c752e29d36f5bcc654a2c38ab002a8a6b2441cba 100644 (file)
@@ -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];
index b0aefc5a03b05ba98653537f36dc566cb4d416e0..b7314c3876cb5be3e7a1f9fb3832aacc279c826e 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "libpq/pqsignal.h"
 #include "getopt_long.h"
+#include "miscadmin.h"
 
 #if defined(__CYGWIN__)
 #include <sys/cygwin.h>
@@ -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);
index 9c848305e180574b16b18bbe76f808eb39554960..d0a152064888f27c033176a8fec8d323b9ae5448 100644 (file)
@@ -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"
 
 
 /*****************************************************************************