# Description: Change psql to not prompt for a password if PGPASSWORD is given, just as in earlier versions. Without that, there is no way to suppress the password input prompt, which is bad for scripts.
--- postgresql-8.3RC1/src/bin/psql/startup.c	2008-01-04 14:48:17.000000000 +0100
+++ postgresql-8.3RC1/src/bin/psql/startup.c	2008-01-04 14:49:24.000000000 +0100
@@ -199,7 +199,7 @@
 
 		if (PQstatus(pset.db) == CONNECTION_BAD &&
 			PQconnectionNeedsPassword(pset.db) &&
-			password == NULL &&
+			password == NULL && !getenv("PGPASSWORD") &&
 			!feof(stdin))
 		{
 			PQfinish(pset.db);
