diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c
new file mode 100644
index 8fce305..bf30dcd
*** a/contrib/pg_upgrade/server.c
--- b/contrib/pg_upgrade/server.c
*************** check_for_libpq_envvars(void)
*** 254,260 ****
  {
  	PQconninfoOption *option;
  	PQconninfoOption *start;
- 	bool		found = false;
  
  	/* Get valid libpq env vars from the PQconndefaults function */
  
--- 254,259 ----
*************** check_for_libpq_envvars(void)
*** 264,290 ****
  	{
  		if (option->envvar)
  		{
! 			const char *value;
  
  			/* This allows us to see error messages in the local encoding */
  			if (strcmp(option->envvar, "PGCLIENTENCODING") == 0)
  				continue;
  
- 			value = getenv(option->envvar);
  			if (value && strlen(value) > 0)
  			{
! 				found = true;
! 
  				pg_log(PG_WARNING,
! 					   "libpq env var %-20s is currently set to: %s\n", option->envvar, value);
  			}
  		}
  	}
  
  	/* Free the memory that libpq allocated on our behalf */
  	PQconninfoFree(start);
- 
- 	if (found)
- 		pg_log(PG_FATAL,
- 			   "libpq env vars have been found and listed above, please unset them for pg_upgrade\n");
  }
--- 263,287 ----
  	{
  		if (option->envvar)
  		{
! 			const char *value = getenv(option->envvar);
  
  			/* This allows us to see error messages in the local encoding */
  			if (strcmp(option->envvar, "PGCLIENTENCODING") == 0)
  				continue;
  
  			if (value && strlen(value) > 0)
  			{
! #ifndef WIN32
! 				unsetenv(option->envvar);
! #else
! 				SetEnvironmentVariableA(option->envvar, "");
! #endif
  				pg_log(PG_WARNING,
! 					"ignoring libpq environment variable %s\n", option->envvar);
  			}
  		}
  	}
  
  	/* Free the memory that libpq allocated on our behalf */
  	PQconninfoFree(start);
  }
