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

Commit2d8ef5e

Browse files
committed
Add new error code for "file name too long"
This new error code, named file_name_too_long, maps internally to theerrno ENAMETOOLONG to produce a proper error code rather than aninternal code under errcode_for_file_access(). This error code can bereached with some SQL command patterns, like a snapshot file name.Reported-by: Alexander LakhinReviewed-by: Daniel GustafssonDiscussion:https://postgr.es/m/Zo4ROR9mgy8bowMo@paquier.xyz
1 parent5ec2c52 commit2d8ef5e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

‎src/backend/utils/errcodes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ Section: Class 58 - System Error (errors external to PostgreSQL itself)
439439
58030 E ERRCODE_IO_ERROR io_error
440440
58P01 E ERRCODE_UNDEFINED_FILE undefined_file
441441
58P02 E ERRCODE_DUPLICATE_FILE duplicate_file
442+
58P03 E ERRCODE_FILE_NAME_TOO_LONG file_name_too_long
442443

443444
Section: Class F0 - Configuration File Error
444445

‎src/backend/utils/error/elog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,10 @@ errcode_for_file_access(void)
929929
edata->sqlerrcode=ERRCODE_IO_ERROR;
930930
break;
931931

932+
caseENAMETOOLONG:/* File name too long */
933+
edata->sqlerrcode=ERRCODE_FILE_NAME_TOO_LONG;
934+
break;
935+
932936
/* All else is classified as internal errors */
933937
default:
934938
edata->sqlerrcode=ERRCODE_INTERNAL_ERROR;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp