1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Replace appendPQExpBuffer(..., <constant>) with appendPQExpBufferStr

Arguably makes the code a bit more readable, and might give a small
performance gain.

David Rowley
This commit is contained in:
Heikki Linnakangas
2013-11-18 18:29:01 +02:00
parent f1df4731ee
commit 32ceba3ea7
15 changed files with 739 additions and 750 deletions

View File

@@ -248,13 +248,13 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool and_analyz
if (analyze_only)
{
appendPQExpBuffer(&sql, "ANALYZE");
appendPQExpBufferStr(&sql, "ANALYZE");
if (verbose)
appendPQExpBuffer(&sql, " VERBOSE");
appendPQExpBufferStr(&sql, " VERBOSE");
}
else
{
appendPQExpBuffer(&sql, "VACUUM");
appendPQExpBufferStr(&sql, "VACUUM");
if (PQserverVersion(conn) >= 90000)
{
const char *paren = " (";
@@ -282,23 +282,23 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool and_analyz
sep = comma;
}
if (sep != paren)
appendPQExpBuffer(&sql, ")");
appendPQExpBufferStr(&sql, ")");
}
else
{
if (full)
appendPQExpBuffer(&sql, " FULL");
appendPQExpBufferStr(&sql, " FULL");
if (freeze)
appendPQExpBuffer(&sql, " FREEZE");
appendPQExpBufferStr(&sql, " FREEZE");
if (verbose)
appendPQExpBuffer(&sql, " VERBOSE");
appendPQExpBufferStr(&sql, " VERBOSE");
if (and_analyze)
appendPQExpBuffer(&sql, " ANALYZE");
appendPQExpBufferStr(&sql, " ANALYZE");
}
}
if (table)
appendPQExpBuffer(&sql, " %s", table);
appendPQExpBuffer(&sql, ";\n");
appendPQExpBufferStr(&sql, ";\n");
if (!executeMaintenanceCommand(conn, sql.data, echo))
{