Index: src/bin/initdb/initdb.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/initdb/initdb.c,v
retrieving revision 1.61
diff -c -c -r1.61 initdb.c
*** src/bin/initdb/initdb.c	12 Oct 2004 21:54:42 -0000	1.61
--- src/bin/initdb/initdb.c	15 Oct 2004 04:16:47 -0000
***************
*** 2268,2285 ****
  	if ((ret = find_other_exec(argv[0], "postgres", PG_VERSIONSTR,
  							   backend_exec)) < 0)
  	{
  		if (ret == -1)
  			fprintf(stderr,
  					_("The program \"postgres\" is needed by %s "
! 				   "but was not found in the same directory as \"%s\".\n"
  					  "Check your installation.\n"),
! 					progname, progname);
  		else
  			fprintf(stderr,
! 					_("The program \"postgres\" was found by %s "
! 					  "but was not the same version as \"%s\".\n"
  					  "Check your installation.\n"),
! 					progname, progname);
  		exit(1);
  	}
  
--- 2268,2291 ----
  	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\n"
! 					  "same directory as \"%s\".\n"
  					  "Check your installation.\n"),
! 					progname, full_path);
  		else
  			fprintf(stderr,
! 					_("The program \"postgres\" was found by \"%s\"\n"
! 					  "but was not the same version as %s.\n"
  					  "Check your installation.\n"),
! 					full_path, progname);
  		exit(1);
  	}
  
Index: src/bin/pg_ctl/pg_ctl.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/pg_ctl/pg_ctl.c,v
retrieving revision 1.35
diff -c -c -r1.35 pg_ctl.c
*** src/bin/pg_ctl/pg_ctl.c	13 Oct 2004 10:35:05 -0000	1.35
--- src/bin/pg_ctl/pg_ctl.c	15 Oct 2004 04:16:50 -0000
***************
*** 524,540 ****
  		if ((ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR,
  								   postmaster_path)) < 0)
  		{
  			if (ret == -1)
  				write_stderr(_("The program \"postmaster\" is needed by %s "
! 							"but was not found in the same directory as "
! 							   "\"%s\".\n"
  							   "Check your installation.\n"),
! 							 progname, progname);
  			else
! 				write_stderr(_("The program \"postmaster\" was found by %s "
! 							   "but was not the same version as \"%s\".\n"
  							   "Check your installation.\n"),
! 							 progname, progname);
  			exit(1);
  		}
  		postgres_path = postmaster_path;
--- 524,545 ----
  		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\n"
! 							   "same directory as \"%s\".\n"
  							   "Check your installation.\n"),
! 							 progname, full_path);
  			else
! 				write_stderr(_("The program \"postmaster\" was found by \"%s\"\n"
! 							   "but was not the same version as %s.\n"
  							   "Check your installation.\n"),
! 							 full_path, progname);
  			exit(1);
  		}
  		postgres_path = postmaster_path;
Index: src/bin/pg_dump/pg_dumpall.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v
retrieving revision 1.52
diff -c -c -r1.52 pg_dumpall.c
*** src/bin/pg_dump/pg_dumpall.c	6 Oct 2004 17:02:02 -0000	1.52
--- src/bin/pg_dump/pg_dumpall.c	15 Oct 2004 04:16:51 -0000
***************
*** 139,156 ****
  	if ((ret = find_other_exec(argv[0], "pg_dump", PG_VERSIONSTR,
  							   pg_dump_bin)) < 0)
  	{
  		if (ret == -1)
  			fprintf(stderr,
  					_("The program \"pg_dump\" is needed by %s "
! 				   "but was not found in the same directory as \"%s\".\n"
  					  "Check your installation.\n"),
! 					progname, progname);
  		else
  			fprintf(stderr,
! 					_("The program \"pg_dump\" was found by %s "
! 					  "but was not the same version as \"%s\".\n"
  					  "Check your installation.\n"),
! 					progname, progname);
  		exit(1);
  	}
  
--- 139,162 ----
  	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\n"
! 					  "same directory as \"%s\".\n"
  					  "Check your installation.\n"),
! 					progname, full_path);
  		else
  			fprintf(stderr,
! 					_("The program \"pg_dump\" was found by \"%s\"\n"
! 					  "but was not the same version as %s.\n"
  					  "Check your installation.\n"),
! 					full_path, progname);
  		exit(1);
  	}
  
