aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/createlang.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-12-23 15:45:43 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2015-12-23 15:45:43 -0500
commit3945b6193240cd7fcb5ad3c67e9dca7f12d68b7e (patch)
tree185e9a5df69a036fd8c4c17835256e0e2a815c7d /src/bin/scripts/createlang.c
parenta21994c1bf9e61d263a870c98ba1e5f559107b4e (diff)
downloadpostgresql-3945b6193240cd7fcb5ad3c67e9dca7f12d68b7e.tar.gz
postgresql-3945b6193240cd7fcb5ad3c67e9dca7f12d68b7e.zip
Improve handling of password reuse in src/bin/scripts programs.
This reverts most of commit 83dec5a71 in favor of having connectDatabase() store the possibly-reusable password in a static variable, similar to the coding we've had for a long time in pg_dump's version of that function. To avoid possible problems with unwanted password reuse, make callers specify whether it's reasonable to attempt to re-use the password. This is a wash for cases where re-use isn't needed, but it is far simpler for callers that do want that. Functionally there should be no difference. Even though we're past RC1, it seems like a good idea to back-patch this into 9.5, like the prior commit. Otherwise, if there are any third-party users of connectDatabase(), they'll have to deal with an API change in 9.5 and then another one in 9.6. Michael Paquier
Diffstat (limited to 'src/bin/scripts/createlang.c')
-rw-r--r--src/bin/scripts/createlang.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/scripts/createlang.c b/src/bin/scripts/createlang.c
index 87cd623d251..f3496240922 100644
--- a/src/bin/scripts/createlang.c
+++ b/src/bin/scripts/createlang.c
@@ -140,8 +140,8 @@ main(int argc, char *argv[])
printQueryOpt popt;
static const bool translate_columns[] = {false, true};
- conn = connectDatabase(dbname, host, port, username, NULL,
- prompt_password, progname, false);
+ conn = connectDatabase(dbname, host, port, username, prompt_password,
+ progname, false, false);
printfPQExpBuffer(&sql, "SELECT lanname as \"%s\", "
"(CASE WHEN lanpltrusted THEN '%s' ELSE '%s' END) as \"%s\" "
@@ -180,8 +180,8 @@ main(int argc, char *argv[])
if (*p >= 'A' && *p <= 'Z')
*p += ('a' - 'A');
- conn = connectDatabase(dbname, host, port, username, NULL,
- prompt_password, progname, false);
+ conn = connectDatabase(dbname, host, port, username, prompt_password,
+ progname, false, false);
/*
* Make sure the language isn't already installed