aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-10-15 04:32:28 +0000
committerBruce Momjian <bruce@momjian.us>2004-10-15 04:32:28 +0000
commita49f6ad0140a2b4e7915dfb22df3a331d4fcadad (patch)
tree96d59e46c063a0f03d002ac35cd7f8f44d108881 /src
parent8ff374ce91f386e61460866d8e51d996daaceccc (diff)
downloadpostgresql-a49f6ad0140a2b4e7915dfb22df3a331d4fcadad.tar.gz
postgresql-a49f6ad0140a2b4e7915dfb22df3a331d4fcadad.zip
Add full path in error report for version mismatch of binaries.
Diffstat (limited to 'src')
-rw-r--r--src/bin/initdb/initdb.c18
-rw-r--r--src/bin/pg_ctl/pg_ctl.c19
-rw-r--r--src/bin/pg_dump/pg_dumpall.c18
3 files changed, 36 insertions, 19 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index da698e55dee..e00c2f9c182 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.61 2004/10/12 21:54:42 petere Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.62 2004/10/15 04:31:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2268,18 +2268,24 @@ main(int argc, char *argv[])
if ((ret = find_other_exec(argv[0], "postgres", PG_VERSIONSTR,
backend_exec)) < 0)
{
+ char full_path[MAXPGPATH];
+
+ if (find_my_exec(argv[0], full_path) < 0)
+ StrNCpy(full_path, progname, MAXPGPATH);
+
if (ret == -1)
fprintf(stderr,
_("The program \"postgres\" is needed by %s "
- "but was not found in the same directory as \"%s\".\n"
+ "but was not found in the\n"
+ "same directory as \"%s\".\n"
"Check your installation.\n"),
- progname, progname);
+ progname, full_path);
else
fprintf(stderr,
- _("The program \"postgres\" was found by %s "
- "but was not the same version as \"%s\".\n"
+ _("The program \"postgres\" was found by \"%s\"\n"
+ "but was not the same version as %s.\n"
"Check your installation.\n"),
- progname, progname);
+ full_path, progname);
exit(1);
}
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index d4b69a8bc37..7f9ac2f468d 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.36 2004/10/15 01:36:12 neilc Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.37 2004/10/15 04:32:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -531,17 +531,22 @@ do_start(void)
if ((ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR,
postmaster_path)) < 0)
{
+ char full_path[MAXPGPATH];
+
+ if (find_my_exec(argv0, full_path) < 0)
+ StrNCpy(full_path, progname, MAXPGPATH);
+
if (ret == -1)
write_stderr(_("The program \"postmaster\" is needed by %s "
- "but was not found in the same directory as "
- "\"%s\".\n"
+ "but was not found in the\n"
+ "same directory as \"%s\".\n"
"Check your installation.\n"),
- progname, progname);
+ progname, full_path);
else
- write_stderr(_("The program \"postmaster\" was found by %s "
- "but was not the same version as \"%s\".\n"
+ write_stderr(_("The program \"postmaster\" was found by \"%s\"\n"
+ "but was not the same version as %s.\n"
"Check your installation.\n"),
- progname, progname);
+ full_path, progname);
exit(1);
}
postgres_path = postmaster_path;
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index df6041b0485..1b26ebb4dc9 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.52 2004/10/06 17:02:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.53 2004/10/15 04:32:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -139,18 +139,24 @@ main(int argc, char *argv[])
if ((ret = find_other_exec(argv[0], "pg_dump", PG_VERSIONSTR,
pg_dump_bin)) < 0)
{
+ char full_path[MAXPGPATH];
+
+ if (find_my_exec(argv[0], full_path) < 0)
+ StrNCpy(full_path, progname, MAXPGPATH);
+
if (ret == -1)
fprintf(stderr,
_("The program \"pg_dump\" is needed by %s "
- "but was not found in the same directory as \"%s\".\n"
+ "but was not found in the\n"
+ "same directory as \"%s\".\n"
"Check your installation.\n"),
- progname, progname);
+ progname, full_path);
else
fprintf(stderr,
- _("The program \"pg_dump\" was found by %s "
- "but was not the same version as \"%s\".\n"
+ _("The program \"pg_dump\" was found by \"%s\"\n"
+ "but was not the same version as %s.\n"
"Check your installation.\n"),
- progname, progname);
+ full_path, progname);
exit(1);
}