diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-01-09 00:15:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-01-09 00:15:19 +0000 |
commit | 05fb316fbbfb6cbf3ab3377a2fd36f785b6c5b5f (patch) | |
tree | 85fd94be2051cc3417d47515f16acebe9c19a3f3 /src/bin/scripts/createuser.c | |
parent | 2fb41f900a8650737aa37d5aab0e58a0dee94f3d (diff) | |
download | postgresql-05fb316fbbfb6cbf3ab3377a2fd36f785b6c5b5f.tar.gz postgresql-05fb316fbbfb6cbf3ab3377a2fd36f785b6c5b5f.zip |
Fix incorrect SQL syntax emitted when -E is given without -P.
Report and fix from Martin Pitt.
Diffstat (limited to 'src/bin/scripts/createuser.c')
-rw-r--r-- | src/bin/scripts/createuser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/scripts/createuser.c b/src/bin/scripts/createuser.c index 091cf47cd36..bf9bfd215c4 100644 --- a/src/bin/scripts/createuser.c +++ b/src/bin/scripts/createuser.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/bin/scripts/createuser.c,v 1.6.4.1 2004/01/01 19:27:28 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/scripts/createuser.c,v 1.6.4.2 2004/01/09 00:15:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -189,12 +189,12 @@ main(int argc, char *argv[]) printfPQExpBuffer(&sql, "CREATE USER %s", fmtId(newuser)); if (sysid) appendPQExpBuffer(&sql, " SYSID %s", sysid); - if (encrypted == +1) - appendPQExpBuffer(&sql, " ENCRYPTED"); - if (encrypted == -1) - appendPQExpBuffer(&sql, " UNENCRYPTED"); if (newpassword) { + if (encrypted == +1) + appendPQExpBuffer(&sql, " ENCRYPTED"); + if (encrypted == -1) + appendPQExpBuffer(&sql, " UNENCRYPTED"); appendPQExpBuffer(&sql, " PASSWORD "); appendStringLiteral(&sql, newpassword, false); } |