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

Commit5baf869

Browse files
committed
pg_dump: Remove query truncation in error messages
Remove the behavior that a query mentioned in an error message would betruncated to 128 characters. The queries that pg_dump runs are oftenlonger than that, and this behavior makes analyzing failures harderunnecessarily.Discussion:https://www.postgresql.org/message-id/flat/63201ef9-26fb-3f1f-664d-98531678cebc%402ndquadrant.com
1 parent4fdb8a8 commit5baf869

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

‎src/bin/pg_dump/pg_backup_db.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#endif
2626

2727

28-
#defineDB_MAX_ERR_STMT 128
29-
3028
/* translator: this is a module name */
3129
staticconstchar*modulename=gettext_noop("archiver (db)");
3230

@@ -449,7 +447,6 @@ ExecuteSqlCommand(ArchiveHandle *AH, const char *qry, const char *desc)
449447
{
450448
PGconn*conn=AH->connection;
451449
PGresult*res;
452-
charerrStmt[DB_MAX_ERR_STMT];
453450

454451
#ifdefNOT_USED
455452
fprintf(stderr,"Executing: '%s'\n\n",qry);
@@ -469,16 +466,8 @@ ExecuteSqlCommand(ArchiveHandle *AH, const char *qry, const char *desc)
469466
break;
470467
default:
471468
/* trouble */
472-
strncpy(errStmt,qry,DB_MAX_ERR_STMT);/* strncpy required here */
473-
if (errStmt[DB_MAX_ERR_STMT-1]!='\0')
474-
{
475-
errStmt[DB_MAX_ERR_STMT-4]='.';
476-
errStmt[DB_MAX_ERR_STMT-3]='.';
477-
errStmt[DB_MAX_ERR_STMT-2]='.';
478-
errStmt[DB_MAX_ERR_STMT-1]='\0';
479-
}
480469
warn_or_exit_horribly(AH,modulename,"%s: %s Command was: %s\n",
481-
desc,PQerrorMessage(conn),errStmt);
470+
desc,PQerrorMessage(conn),qry);
482471
break;
483472
}
484473

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp