From 9de59fd191dc86e7a49a5d7726ef09041549fc88 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 26 Feb 2009 16:02:39 +0000 Subject: Add a -w/--no-password option that prevents all password prompts to all programs that have a -W/--password option. In passing, remove the ancient PSQL_ALWAYS_GET_PASSWORDS compile option. --- src/bin/psql/command.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bin/psql/command.c') diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 41888666de1..24c5b4d53ce 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.202 2009/01/20 02:13:42 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.203 2009/02/26 16:02:38 petere Exp $ */ #include "postgres_fe.h" #include "command.h" @@ -1212,7 +1212,7 @@ do_connect(char *dbname, char *user, char *host, char *port) * the postmaster's log. But libpq offers no API that would let us obtain * a password and then continue with the first connection attempt. */ - if (pset.getPassword) + if (pset.getPassword == TRI_YES) { password = prompt_for_password(user); } @@ -1237,7 +1237,7 @@ do_connect(char *dbname, char *user, char *host, char *port) * Connection attempt failed; either retry the connection attempt with * a new password, or give up. */ - if (!password && PQconnectionNeedsPassword(n_conn)) + if (!password && PQconnectionNeedsPassword(n_conn) && pset.getPassword != TRI_NO) { PQfinish(n_conn); password = prompt_for_password(user); -- cgit v1.2.3