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

Commit18c41cb

Browse files
author
Amit Kapila
committed
Add missing errcode() in a few ereport calls.
This will allow to specifying SQLSTATE error code for the errors in themissing places.Reported-by: Sawada MasahikoAuthor: Sawada MasahikoBackpatch-through: 9.5Discussion:https://postgr.es/m/CA+fd4k6N8EjNvZpM8nme+y+05mz-SM8Z_BgkixzkA34R+ej0Kw@mail.gmail.com
1 parent974c8ea commit18c41cb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎contrib/adminpack/adminpack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pg_file_write_internal(text *file, text *data, bool replace)
187187

188188
if (stat(filename,&fst) >=0)
189189
ereport(ERROR,
190-
(ERRCODE_DUPLICATE_FILE,
190+
(errcode(ERRCODE_DUPLICATE_FILE),
191191
errmsg("file \"%s\" exists",filename)));
192192

193193
f=AllocateFile(filename,"wb");
@@ -319,7 +319,7 @@ pg_file_rename_internal(text *file1, text *file2, text *file3)
319319
if (rc >=0||errno!=ENOENT)
320320
{
321321
ereport(ERROR,
322-
(ERRCODE_DUPLICATE_FILE,
322+
(errcode(ERRCODE_DUPLICATE_FILE),
323323
errmsg("cannot rename to target file \"%s\"",
324324
fn3 ?fn3 :fn2)));
325325
}
@@ -350,7 +350,7 @@ pg_file_rename_internal(text *file1, text *file2, text *file3)
350350
else
351351
{
352352
ereport(ERROR,
353-
(ERRCODE_UNDEFINED_FILE,
353+
(errcode(ERRCODE_UNDEFINED_FILE),
354354
errmsg("renaming \"%s\" to \"%s\" was reverted",
355355
fn2,fn3)));
356356
}

‎src/backend/storage/page/bufpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ PageIsVerified(Page page, BlockNumber blkno)
147147
if (checksum_failure)
148148
{
149149
ereport(WARNING,
150-
(ERRCODE_DATA_CORRUPTED,
150+
(errcode(ERRCODE_DATA_CORRUPTED),
151151
errmsg("page verification failed, calculated checksum %u but expected %u",
152152
checksum,p->pd_checksum)));
153153

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp