diff options
author | Robert Haas | 2011-12-06 13:48:15 +0000 |
---|---|---|
committer | Robert Haas | 2011-12-06 13:48:15 +0000 |
commit | 68281e00540a29e7f9bfc154c25a78b875f560d1 (patch) | |
tree | edd65f9661d0efcdc11780cea0466c1f8aeb6715 /src/bin/scripts/common.h | |
parent | 6ef4ae1d4e829675c332c39895fdf90e15c3faeb (diff) |
Make command-line tools smarter about finding a DB to connect to.
If unable to connect to "postgres", try "template1". This allows things to
work more smoothly in the case where the postgres database has been
dropped. And just in case that's not good enough, also allow the user to
specify a maintenance database to be used for the initial connection, to
cover the case where neither postgres nor template1 is suitable.
Diffstat (limited to 'src/bin/scripts/common.h')
-rw-r--r-- | src/bin/scripts/common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h index caa9e81f457..9ebd72873d4 100644 --- a/src/bin/scripts/common.h +++ b/src/bin/scripts/common.h @@ -30,6 +30,11 @@ extern void handle_help_version_opts(int argc, char *argv[], extern PGconn *connectDatabase(const char *dbname, const char *pghost, const char *pgport, const char *pguser, + enum trivalue prompt_password, const char *progname, + bool fail_ok); + +extern PGconn *connectMaintenanceDatabase(const char *maintenance_db, + const char *pghost, const char *pgport, const char *pguser, enum trivalue prompt_password, const char *progname); extern PGresult *executeQuery(PGconn *conn, const char *query, |