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

Commit1029bde

Browse files
committed
Improve enlargeStringInfo's ERROR message
Until now, when an enlargeStringInfo() call would cause the StringInfo toexceed its maximum size, we reported an "out of memory" error. This ismisleading as it's no such thing.Here we remove the "out of memory" text and replace it with somethingmore relevant to better indicate that it's a program limitation that'sbeen reached.Reported-by: Michael BanckReviewed-by: Daniel Gustafsson, Tom LaneDiscussion:https://postgr.es/m/18484-3e357ade5fe50e61@postgresql.org
1 parente26810d commit1029bde

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/common/stringinfo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ enlargeStringInfo(StringInfo str, int needed)
311311
#ifndefFRONTEND
312312
ereport(ERROR,
313313
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
314-
errmsg("out of memory"),
314+
errmsg("string buffer exceeds maximum allowed length (%zu bytes)",MaxAllocSize),
315315
errdetail("Cannot enlarge string buffer containing %d bytes by %d more bytes.",
316316
str->len,needed)));
317317
#else
318318
fprintf(stderr,
319-
_("out of memory\n\nCannot enlarge string buffer containing %d bytes by %d more bytes.\n"),
320-
str->len,needed);
319+
_("string buffer exceeds maximum allowed length (%zu bytes)\n\nCannot enlarge string buffer containing %d bytes by %d more bytes.\n"),
320+
MaxAllocSize,str->len,needed);
321321
exit(EXIT_FAILURE);
322322
#endif
323323
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp