summaryrefslogtreecommitdiff
path: root/src/bin/scripts/common.c
diff options
context:
space:
mode:
authorBruce Momjian2004-10-16 03:10:17 +0000
committerBruce Momjian2004-10-16 03:10:17 +0000
commit2c19bc3ea39ab41e90c74618810404226a8a912c (patch)
tree0a91c4214e46f102c9e092efbac4468812942462 /src/bin/scripts/common.c
parent9219e8c5856b77ed2dca51ae608a4320a87d3b39 (diff)
Allow pg_ctl to determine the server is up when getting a request for a
password. Make password error message a #define and use it consistently. Sean Chittenden
Diffstat (limited to 'src/bin/scripts/common.c')
-rw-r--r--src/bin/scripts/common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index 9a2a9ea284..dc6c26aa4b 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -12,6 +12,7 @@
#include "postgres_fe.h"
#include "common.h"
+#include "libpq-fe.h"
#include <pwd.h>
#include <unistd.h>
@@ -102,7 +103,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
}
if (PQstatus(conn) == CONNECTION_BAD &&
- strcmp(PQerrorMessage(conn), "fe_sendauth: no password supplied\n") == 0 &&
+ strcmp(PQerrorMessage(conn), PQnoPasswordSupplied) == 0 &&
!feof(stdin))
{
PQfinish(conn);