aboutsummaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_upgrade/server.c')
-rw-r--r--contrib/pg_upgrade/server.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c
index 3d041efbfd0..fc0d22e2df7 100644
--- a/contrib/pg_upgrade/server.c
+++ b/contrib/pg_upgrade/server.c
@@ -104,22 +104,22 @@ cluster_conn_opts(ClusterInfo *cluster)
PGresult *
executeQueryOrDie(PGconn *conn, const char *fmt,...)
{
- static char command[8192];
+ static char query[QUERY_ALLOC];
va_list args;
PGresult *result;
ExecStatusType status;
va_start(args, fmt);
- vsnprintf(command, sizeof(command), fmt, args);
+ vsnprintf(query, sizeof(query), fmt, args);
va_end(args);
- pg_log(PG_VERBOSE, "executing: %s\n", command);
- result = PQexec(conn, command);
+ pg_log(PG_VERBOSE, "executing: %s\n", query);
+ result = PQexec(conn, query);
status = PQresultStatus(result);
if ((status != PGRES_TUPLES_OK) && (status != PGRES_COMMAND_OK))
{
- pg_log(PG_REPORT, "SQL command failed\n%s\n%s\n", command,
+ pg_log(PG_REPORT, "SQL command failed\n%s\n%s\n", query,
PQerrorMessage(conn));
PQclear(result);
PQfinish(conn);