From 2c19bc3ea39ab41e90c74618810404226a8a912c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 16 Oct 2004 03:10:17 +0000 Subject: 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 --- src/bin/scripts/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bin/scripts/common.c') 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 #include @@ -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); -- cgit v1.2.3