diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2009-02-26 16:02:39 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2009-02-26 16:02:39 +0000 |
commit | 9de59fd191dc86e7a49a5d7726ef09041549fc88 (patch) | |
tree | 9edc44560aa7beca92b7bc6c8e889c78655172c0 /src/bin/pg_dump/pg_backup_archiver.c | |
parent | eea49769d415b00ea36e2ee64774cb4d1313d991 (diff) | |
download | postgresql-9de59fd191dc86e7a49a5d7726ef09041549fc88.tar.gz postgresql-9de59fd191dc86e7a49a5d7726ef09041549fc88.zip |
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.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.c')
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 0b46e1097b3..b768f5c2867 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.163 2009/02/20 02:57:21 adunstan Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.164 2009/02/26 16:02:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -246,7 +246,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt) ConnectDatabase(AHX, ropt->dbname, ropt->pghost, ropt->pgport, ropt->username, - ropt->requirePassword); + ropt->promptPassword); /* * If we're talking to the DB directly, don't send comments since they @@ -609,6 +609,7 @@ NewRestoreOptions(void) /* set any fields that shouldn't default to zeroes */ opts->format = archUnknown; + opts->promptPassword = TRI_DEFAULT; return opts; } @@ -1886,6 +1887,8 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt, else AH->format = fmt; + AH->promptPassword = TRI_DEFAULT; + switch (AH->format) { case archCustom: @@ -3206,7 +3209,7 @@ restore_toc_entries_parallel(ArchiveHandle *AH) */ ConnectDatabase((Archive *) AH, ropt->dbname, ropt->pghost, ropt->pgport, ropt->username, - ropt->requirePassword); + ropt->promptPassword); _doSetFixedOutputState(AH); @@ -3476,7 +3479,7 @@ parallel_restore(RestoreArgs *args) */ ConnectDatabase((Archive *) AH, ropt->dbname, ropt->pghost, ropt->pgport, ropt->username, - ropt->requirePassword); + ropt->promptPassword); _doSetFixedOutputState(AH); |