diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2013-11-18 18:29:01 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2013-11-18 18:34:51 +0200 |
commit | 32ceba3ea730b6b1bd3eca786f72d61945ad42b7 (patch) | |
tree | 4370209d2561aeff498b30303ead012e162f2cd9 /src/bin/scripts/createuser.c | |
parent | f1df4731eea6bc05e0769e9cc789e7304722efe4 (diff) | |
download | postgresql-32ceba3ea730b6b1bd3eca786f72d61945ad42b7.tar.gz postgresql-32ceba3ea730b6b1bd3eca786f72d61945ad42b7.zip |
Replace appendPQExpBuffer(..., <constant>) with appendPQExpBufferStr
Arguably makes the code a bit more readable, and might give a small
performance gain.
David Rowley
Diffstat (limited to 'src/bin/scripts/createuser.c')
-rw-r--r-- | src/bin/scripts/createuser.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/bin/scripts/createuser.c b/src/bin/scripts/createuser.c index d1542d945ac..83623ea8792 100644 --- a/src/bin/scripts/createuser.c +++ b/src/bin/scripts/createuser.c @@ -254,10 +254,10 @@ main(int argc, char *argv[]) if (newpassword) { if (encrypted == TRI_YES) - appendPQExpBuffer(&sql, " ENCRYPTED"); + appendPQExpBufferStr(&sql, " ENCRYPTED"); if (encrypted == TRI_NO) - appendPQExpBuffer(&sql, " UNENCRYPTED"); - appendPQExpBuffer(&sql, " PASSWORD "); + appendPQExpBufferStr(&sql, " UNENCRYPTED"); + appendPQExpBufferStr(&sql, " PASSWORD "); if (encrypted != TRI_NO) { @@ -277,32 +277,32 @@ main(int argc, char *argv[]) appendStringLiteralConn(&sql, newpassword, conn); } if (superuser == TRI_YES) - appendPQExpBuffer(&sql, " SUPERUSER"); + appendPQExpBufferStr(&sql, " SUPERUSER"); if (superuser == TRI_NO) - appendPQExpBuffer(&sql, " NOSUPERUSER"); + appendPQExpBufferStr(&sql, " NOSUPERUSER"); if (createdb == TRI_YES) - appendPQExpBuffer(&sql, " CREATEDB"); + appendPQExpBufferStr(&sql, " CREATEDB"); if (createdb == TRI_NO) - appendPQExpBuffer(&sql, " NOCREATEDB"); + appendPQExpBufferStr(&sql, " NOCREATEDB"); if (createrole == TRI_YES) - appendPQExpBuffer(&sql, " CREATEROLE"); + appendPQExpBufferStr(&sql, " CREATEROLE"); if (createrole == TRI_NO) - appendPQExpBuffer(&sql, " NOCREATEROLE"); + appendPQExpBufferStr(&sql, " NOCREATEROLE"); if (inherit == TRI_YES) - appendPQExpBuffer(&sql, " INHERIT"); + appendPQExpBufferStr(&sql, " INHERIT"); if (inherit == TRI_NO) - appendPQExpBuffer(&sql, " NOINHERIT"); + appendPQExpBufferStr(&sql, " NOINHERIT"); if (login == TRI_YES) - appendPQExpBuffer(&sql, " LOGIN"); + appendPQExpBufferStr(&sql, " LOGIN"); if (login == TRI_NO) - appendPQExpBuffer(&sql, " NOLOGIN"); + appendPQExpBufferStr(&sql, " NOLOGIN"); if (replication == TRI_YES) - appendPQExpBuffer(&sql, " REPLICATION"); + appendPQExpBufferStr(&sql, " REPLICATION"); if (replication == TRI_NO) - appendPQExpBuffer(&sql, " NOREPLICATION"); + appendPQExpBufferStr(&sql, " NOREPLICATION"); if (conn_limit != NULL) appendPQExpBuffer(&sql, " CONNECTION LIMIT %s", conn_limit); - appendPQExpBuffer(&sql, ";\n"); + appendPQExpBufferStr(&sql, ";\n"); if (echo) printf("%s", sql.data); |