diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 32ebb2c48ea1494519d1d16530286efb456c1602..805fd679bed1bac81016ac4a7fbc8e5aa171e1d5 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.190 2000/11/25 04:13:17 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.191 2000/11/25 19:05:42 petere Exp $
  *
  * NOTES
  *
@@ -310,6 +310,25 @@ PostmasterMain(int argc, char *argv[])
 	real_argv = argv;
 	real_argc = argc;
 
+	/*
+	 * Catch standard options before doing much else.  This even works
+	 * on systems without getopt_long.
+	 */
+	if (argc > 1)
+	{
+		if (strcmp(argv[1], "--help")==0 || strcmp(argv[1], "-?")==0)
+		{
+			usage(progname);
+			exit(0);
+		}
+		if (strcmp(argv[1], "--version")==0 || strcmp(argv[1], "-V")==0)
+		{
+			puts("postmaster (PostgreSQL) " PG_VERSION);
+			exit(0);
+		}
+	}		
+
+
 	/*
 	 * for security, no dir or file created can be group or other
 	 * accessible
@@ -358,7 +377,7 @@ PostmasterMain(int argc, char *argv[])
 	 * will occur.
 	 */
 	opterr = 1;
-	while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:SsV-:?")) != EOF)
+	while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != EOF)
 	{
 		switch(opt)
 		{
@@ -366,43 +385,22 @@ PostmasterMain(int argc, char *argv[])
 				potential_DataDir = optarg;
 				break;
 
-			case 'V':
-				puts("postmaster (PostgreSQL) " PG_VERSION);
-				exit(0);
-
-			case '-':
-			{
-				char *name, *value;
-			
-				ParseLongOption(optarg, &name, &value);
-				if (strcmp(name, "help")==0)
-				{
-					usage(progname);
-					exit(0);
-				}
-				else if (strcmp(name, "version")==0)
-				{
-					puts("postmaster (PostgreSQL) " PG_VERSION);
-					exit(0);
-				}
-				break;
-			}
-
 			case '?':
-				if (strcmp(argv[optind - 1], "-?") == 0)
-				{
-					usage(progname);
-					exit(0);
-				}
-				else
-				{
-					fprintf(stderr, "Try -? for help.\n");
-					exit(1);
-				}
-				break;
+				fprintf(stderr, "Try '%s --help' for more information.\n", progname);
+				exit(1);
 		}
 	}
 
+	/*
+	 * Non-option switch arguments don't exist.
+	 */
+	if (optind < argc)
+	{
+		fprintf(stderr, "%s: invalid argument -- %s\n", progname, argv[optind]);
+		fprintf(stderr, "Try '%s --help' for more information.\n", progname);
+		exit(1);
+	}
+
 	checkDataDir(potential_DataDir);	/* issues error messages */
 	SetDataDir(potential_DataDir);
 
@@ -414,7 +412,7 @@ PostmasterMain(int argc, char *argv[])
 #ifdef HAVE_INT_OPTRESET
 	optreset = 1;
 #endif
-	while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:SsV-:?")) != EOF)
+	while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != EOF)
 	{
 		switch (opt)
 		{
@@ -546,20 +544,11 @@ PostmasterMain(int argc, char *argv[])
 
 			default:
 				/* shouldn't get here */
-				fprintf(stderr, "Try -? for help.\n");
+				fprintf(stderr, "Try '%s --help' for more information.\n", progname);
 				exit(1);
 		}
 	}
 
-	/*
-	 * Non-option switch arguments don't exist.
-	 */
-	if (optind < argc)
-	{
-		fprintf(stderr, "%s: invalid argument -- %s\n", progname, argv[optind]);
-		exit(1);
-	}
-
 	/*
 	 * Check for invalid combinations of switches
 	 */
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 86d80660d953dac898944b7a2f20ccf4372e0118..f7d3e1c1b02110bfa5e654f83869a625fc6755a5 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.189 2000/11/21 21:16:02 petere Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.190 2000/11/25 19:05:42 petere Exp $
  *
  * NOTES
  *	  this is the "main" module of the postgres backend and
@@ -1062,6 +1062,24 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
 
 	char       *potential_DataDir = NULL;
 
+	/*
+	 * Catch standard options before doing much else.  This even works
+	 * on systems without getopt_long.
+	 */
+	if (!IsUnderPostmaster && argc > 1)
+	{
+		if (strcmp(argv[1], "--help")==0 || strcmp(argv[1], "-?")==0)
+		{
+			usage(argv[0]);
+			exit(0);
+		}
+		if (strcmp(argv[1], "--version")==0 || strcmp(argv[1], "-V")==0)
+		{
+			puts("postgres (PostgreSQL) " PG_VERSION);
+			exit(0);
+		}
+	}		
+
 	/*
 	 * Fire up essential subsystems: error and memory management
 	 *
@@ -1110,7 +1128,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
 
 	optind = 1;					/* reset after postmaster's usage */
 
-	while ((flag = getopt(argc, argv,  "A:B:c:CD:d:Eef:FiLNOPo:p:S:st:v:VW:x:-:?")) != EOF)
+	while ((flag = getopt(argc, argv,  "A:B:c:CD:d:Eef:FiLNOPo:p:S:st:v:W:x:-:")) != EOF)
 		switch (flag)
 		{
 			case 'A':
@@ -1336,10 +1354,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
 					FrontendProtocol = (ProtocolVersion) atoi(optarg);
 				break;
 
-			case 'V':
-				puts("postgres (PostgreSQL) " PG_VERSION);
-				exit(0);
-
 			case 'W':
 				/* ----------------
 				 *	wait N seconds to allow attach from a debugger
@@ -1387,16 +1401,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
 				char *name, *value;
 
 				ParseLongOption(optarg, &name, &value);
-				if (strcmp(name, "help")==0)
-				{
-					usage(argv[0]);
-					exit(0);
-				}
-				else if (strcmp(name, "version")==0)
-				{
-					puts("postgres (PostgreSQL) " PG_VERSION);
-					exit(0);
-				}
 				if (!value)
 				{
 					if (flag == '-')
@@ -1412,18 +1416,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
 				break;
 			}
 
-			case '?':
-				if (strcmp(argv[optind - 1], "-?") == 0)
-				{
-					usage(argv[0]);
-					exit(0);
-				}
-				else
-					errs++;
-				break;
-
 			default:
-				/* shouldn't get here */
 				errs++;
 				break;
 		}
@@ -1643,7 +1636,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
 	if (!IsUnderPostmaster)
 	{
 		puts("\nPOSTGRES backend interactive interface ");
-		puts("$Revision: 1.189 $ $Date: 2000/11/21 21:16:02 $\n");
+		puts("$Revision: 1.190 $ $Date: 2000/11/25 19:05:42 $\n");
 	}
 
 	/*
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh
index 22843e6fd95fc89e44df85992e036caebf989051..b83b1810250221e888e06f88957a16cce64fa9da 100644
--- a/src/bin/initdb/initdb.sh
+++ b/src/bin/initdb/initdb.sh
@@ -24,7 +24,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.116 2000/11/21 20:55:57 tgl Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.117 2000/11/25 19:05:43 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -253,7 +253,7 @@ do
                 ;;
 	-*)
 		echo "$CMDNAME: invalid option: $1"
-		echo "Try '$CMDNAME -?' for help."
+		echo "Try '$CMDNAME --help' for more information."
 		exit 1
 		;;
         *)
diff --git a/src/bin/initlocation/initlocation.sh b/src/bin/initlocation/initlocation.sh
index df8abda1f43d70cc733163ffdadd3833d0cfe29a..10c802c228d232a83adf8e676e6f4d15fce69285 100644
--- a/src/bin/initlocation/initlocation.sh
+++ b/src/bin/initlocation/initlocation.sh
@@ -8,7 +8,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.9 2000/11/11 22:59:46 petere Exp $
+#    $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.10 2000/11/25 19:05:43 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -51,7 +51,7 @@ do
 
 	-*)
             echo "$CMDNAME: invalid option: $1" 1>&2
-            echo "Try '$CMDNAME -?' for help." 1>&2
+            echo "Try '$CMDNAME --help' for more information." 1>&2
             exit 1
             ;;
 	*)
diff --git a/src/bin/pg_passwd/pg_passwd.c b/src/bin/pg_passwd/pg_passwd.c
index 6faad3088beae11ffe3470c3244aace39f8c729f..db057c88783842aa26cba2def88b41e66fb6a5be 100644
--- a/src/bin/pg_passwd/pg_passwd.c
+++ b/src/bin/pg_passwd/pg_passwd.c
@@ -333,7 +333,7 @@ main(int argc, char *argv[])
 
 	if (argc != 2)
 	{
-		fprintf(stderr, "%s: too %s arguments\nTry '%s -?' for help.\n",
+		fprintf(stderr, "%s: too %s arguments\nTry '%s --help' for more information.\n",
 				progname, argc > 2 ? "many" : "few", progname);
 		exit(1);
 	}
@@ -350,7 +350,7 @@ main(int argc, char *argv[])
 	}
 	if (argv[1][0] == '-')
 	{
-		fprintf(stderr, "%s: invalid option: %s\nTry '%s -?' for help.\n",
+		fprintf(stderr, "%s: invalid option: %s\nTry '%s --help' for more information.\n",
 				progname, argv[1], progname);
 		exit(1);
 	}
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 46e476a2ae013e8470b40976f834b6d7ab20b517..1a66d5fce361d854cfbaf95df640bcd2232a88bd 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -3,7 +3,7 @@
  *
  * Copyright 2000 by PostgreSQL Global Development Group
  *
- * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.39 2000/11/13 23:37:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.40 2000/11/25 19:05:44 petere Exp $
  */
 #include "postgres.h"
 
@@ -107,6 +107,20 @@ main(int argc, char *argv[])
 	else
 		pset.progname = strrchr(argv[0], SEP_CHAR) + 1;
 
+	if (argc > 1)
+	{
+		if (strcmp(argv[1], "--help")==0 || strcmp(argv[1], "-?")==0)
+		{
+			usage();
+			exit(EXIT_SUCCESS);
+		}
+		if (strcmp(argv[1], "--version")==0 || strcmp(argv[1], "-V")==0)
+		{
+			showVersion();
+			exit(EXIT_SUCCESS);
+		}
+	}		
+
 	pset.cur_cmd_source = stdin;
 	pset.cur_cmd_interactive = false;
 	pset.encoding = PQenv2encoding();
@@ -520,19 +534,21 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
 				/* unknown option reported by getopt */
 				else
 				{
-					fputs("Try -? for help.\n", stderr);
+					fprintf(stderr, "Try '%s --help' for more information.\n",
+							pset.progname);
 					exit(EXIT_FAILURE);
 				}
 				break;
 #ifndef HAVE_GETOPT_LONG
 			case '-':
 				fprintf(stderr, "%s was compiled without support for long options.\n"
-						"Use -? for help on invocation options.\n", pset.progname);
+						"Use --help for help on invocation options.\n", pset.progname);
 				exit(EXIT_FAILURE);
 				break;
 #endif
 			default:
-				fputs("Try -? for help.\n", stderr);
+				fprintf(stderr, "Try '%s --help' for more information.\n",
+						pset.progname);
 				exit(EXIT_FAILURE);
 				break;
 		}
diff --git a/src/bin/scripts/createdb b/src/bin/scripts/createdb
index e506af5885cd0dec75b397ac36b99caeedb72409..3937b619138dd8e720071066d85ef3bfb451bdf6 100644
--- a/src/bin/scripts/createdb
+++ b/src/bin/scripts/createdb
@@ -11,7 +11,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.11 2000/11/13 23:37:53 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.12 2000/11/25 19:05:44 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -89,7 +89,7 @@ do
                 ;;
 	-*)
 		echo "$CMDNAME: invalid option: $1" 1>&2
-                echo "Try '$CMDNAME -?' for help." 1>&2
+                echo "Try '$CMDNAME --help' for more information." 1>&2
 		exit 1
 		;;
 	*)
diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh
index 02c27aaf90bb1bad2d3d843384ff43f2c2c586b7..db4189bd0724e1c0bc78695c85e849d2d95a3cb8 100644
--- a/src/bin/scripts/createlang.sh
+++ b/src/bin/scripts/createlang.sh
@@ -8,7 +8,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.20 2000/11/20 20:36:50 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.21 2000/11/25 19:05:44 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -99,7 +99,7 @@ do
 
 	-*)
 		echo "$CMDNAME: invalid option: $1" 1>&2
-                echo "Try '$CMDNAME -?' for help." 1>&2
+                echo "Try '$CMDNAME --help' for more information." 1>&2
 		exit 1
 		;;
 	 *)
diff --git a/src/bin/scripts/createuser b/src/bin/scripts/createuser
index e3859eb2a7537ee91a09ece7b368cdd0bf2b6f91..37a763680557df3770fae43d1ede4dc86bde69e1 100644
--- a/src/bin/scripts/createuser
+++ b/src/bin/scripts/createuser
@@ -8,7 +8,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.14 2000/11/13 23:37:53 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.15 2000/11/25 19:05:44 petere Exp $
 #
 # Note - this should NOT be setuid.
 #
@@ -110,7 +110,7 @@ do
 		;;
 	-*)
 		echo "$CMDNAME: invalid option: $1" 1>&2
-                echo "Try '$CMDNAME -?' for help." 1>&2
+                echo "Try '$CMDNAME --help' for more information." 1>&2
 		exit 1
 		;;
          *)
diff --git a/src/bin/scripts/dropdb b/src/bin/scripts/dropdb
index 35bb08a71afb341dcc255eb7c376eec4e980b5ff..a3db4babe32d2f989715a7109f95545ce4228d01 100644
--- a/src/bin/scripts/dropdb
+++ b/src/bin/scripts/dropdb
@@ -10,7 +10,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.9 2000/11/13 23:37:53 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.10 2000/11/25 19:05:44 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -83,7 +83,7 @@ do
 		;;
 	-*)
 		echo "$CMDNAME: invalid option: $1" 1>&2
-                echo "Try '$CMDNAME -?' for help." 1>&2
+                echo "Try '$CMDNAME --help' for more information." 1>&2
 		exit 1
 		;;
 	 *)
diff --git a/src/bin/scripts/droplang b/src/bin/scripts/droplang
index 023ae4fc996e5ffe2358dded9df4b411d178c8e1..43154b2e7d8ec1e9034c4822f6340d9d280fde4b 100644
--- a/src/bin/scripts/droplang
+++ b/src/bin/scripts/droplang
@@ -8,7 +8,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.10 2000/11/13 23:37:53 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.11 2000/11/25 19:05:44 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -89,7 +89,7 @@ do
 
 	-*)
 		echo "$CMDNAME: invalid option: $1" 1>&2
-                echo "Try '$CMDNAME -?' for help." 1>&2
+                echo "Try '$CMDNAME --help' for more information." 1>&2
 		exit 1
 		;;
 	 *)
diff --git a/src/bin/scripts/dropuser b/src/bin/scripts/dropuser
index e7be5dc867ac3120ac9fe4489d0c4ee3ea71bf5f..21e71d870585b14ed5e5c5f3077f46f892dc95b7 100644
--- a/src/bin/scripts/dropuser
+++ b/src/bin/scripts/dropuser
@@ -8,7 +8,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.9 2000/11/13 23:37:53 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.10 2000/11/25 19:05:44 petere Exp $
 #
 # Note - this should NOT be setuid.
 #
@@ -85,7 +85,7 @@ do
 		;;
 	-*)
 		echo "$CMDNAME: invalid option: $1" 1>&2
-                echo "Try '$CMDNAME -?' for help." 1>&2
+                echo "Try '$CMDNAME --help' for more information." 1>&2
 		exit 1
 		;;
          *)
diff --git a/src/bin/scripts/vacuumdb b/src/bin/scripts/vacuumdb
index 0981f31e72c8e6b169431ecb76d43bdddb396d5a..9b310327a1f2f61f1265698ef8b04be0373cc597 100644
--- a/src/bin/scripts/vacuumdb
+++ b/src/bin/scripts/vacuumdb
@@ -11,7 +11,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.12 2000/11/13 23:37:53 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.13 2000/11/25 19:05:44 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -102,7 +102,7 @@ do
 
 	-*)
 		echo "$CMDNAME: invalid option: $1" 1>&2
-                echo "Try '$CMDNAME -?' for help." 1>&2
+                echo "Try '$CMDNAME --help' for more information." 1>&2
 		exit 1
 		;;
 	*)