diff -ruN postgresql-7.1/src/bin/psql/command.c postgresql-7.1.patched/src/bin/psql/command.c --- postgresql-7.1/src/bin/psql/command.c Fri Mar 23 18:54:56 2001 +++ postgresql-7.1.patched/src/bin/psql/command.c Tue Apr 17 14:36:56 2001 @@ -1281,8 +1281,17 @@ */ psql_error("\\connect: %s", PQerrorMessage(pset.db)); PQfinish(pset.db); + + /* + * if at this point, we have an old connection, clean it up + * and exit cleanly. the script that they are running needs + * to be corrected. + */ if (oldconn) + { PQfinish(oldconn); + exit(EXIT_FAILURE); + } pset.db = NULL; } }