Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7567d94

Browse files
committed
pg_upgrade: adjust logging to use QUERY_ALLOC lengths
Allows the logging to print the entire text of failed queries, ratherthan a truncated version.
1 parent02587dc commit7567d94

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎contrib/pg_upgrade/server.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,22 @@ cluster_conn_opts(ClusterInfo *cluster)
104104
PGresult*
105105
executeQueryOrDie(PGconn*conn,constchar*fmt,...)
106106
{
107-
staticcharcommand[8192];
107+
staticcharquery[QUERY_ALLOC];
108108
va_listargs;
109109
PGresult*result;
110110
ExecStatusTypestatus;
111111

112112
va_start(args,fmt);
113-
vsnprintf(command,sizeof(command),fmt,args);
113+
vsnprintf(query,sizeof(query),fmt,args);
114114
va_end(args);
115115

116-
pg_log(PG_VERBOSE,"executing: %s\n",command);
117-
result=PQexec(conn,command);
116+
pg_log(PG_VERBOSE,"executing: %s\n",query);
117+
result=PQexec(conn,query);
118118
status=PQresultStatus(result);
119119

120120
if ((status!=PGRES_TUPLES_OK)&& (status!=PGRES_COMMAND_OK))
121121
{
122-
pg_log(PG_REPORT,"SQL command failed\n%s\n%s\n",command,
122+
pg_log(PG_REPORT,"SQL command failed\n%s\n%s\n",query,
123123
PQerrorMessage(conn));
124124
PQclear(result);
125125
PQfinish(conn);

‎contrib/pg_upgrade/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0)))
8686
void
8787
pg_log_v(eLogTypetype,constchar*fmt,va_listap)
8888
{
89-
charmessage[MAX_STRING];
89+
charmessage[QUERY_ALLOC];
9090

9191
vsnprintf(message,sizeof(message),fmt,ap);
9292

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp