summaryrefslogtreecommitdiff
path: root/contrib/adminpack/adminpack.c
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2020-03-18 10:10:27 +0530
committerAmit Kapila <akapila@postgresql.org>2020-03-18 10:10:27 +0530
commit6bdfe428d3994bfaed814e818fe93ad9635a31d6 (patch)
tree812921a127884a6f053769b2956851e6f4a12609 /contrib/adminpack/adminpack.c
parentf99363e23102c1dceb83d066e3b16c4688079634 (diff)
Add missing errcode() in a few ereport calls.
This will allow to specifying SQLSTATE error code for the errors in the missing places. Reported-by: Sawada Masahiko Author: Sawada Masahiko Backpatch-through: 9.5 Discussion: https://postgr.es/m/CA+fd4k6N8EjNvZpM8nme+y+05mz-SM8Z_BgkixzkA34R+ej0Kw@mail.gmail.com
Diffstat (limited to 'contrib/adminpack/adminpack.c')
-rw-r--r--contrib/adminpack/adminpack.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/adminpack/adminpack.c b/contrib/adminpack/adminpack.c
index db0b033956e..2dc3544e144 100644
--- a/contrib/adminpack/adminpack.c
+++ b/contrib/adminpack/adminpack.c
@@ -128,7 +128,7 @@ pg_file_write(PG_FUNCTION_ARGS)
if (stat(filename, &fst) >= 0)
ereport(ERROR,
- (ERRCODE_DUPLICATE_FILE,
+ (errcode(ERRCODE_DUPLICATE_FILE),
errmsg("file \"%s\" exists", filename)));
f = AllocateFile(filename, "wb");
@@ -194,7 +194,7 @@ pg_file_rename(PG_FUNCTION_ARGS)
if (rc >= 0 || errno != ENOENT)
{
ereport(ERROR,
- (ERRCODE_DUPLICATE_FILE,
+ (errcode(ERRCODE_DUPLICATE_FILE),
errmsg("cannot rename to target file \"%s\"",
fn3 ? fn3 : fn2)));
}
@@ -225,7 +225,7 @@ pg_file_rename(PG_FUNCTION_ARGS)
else
{
ereport(ERROR,
- (ERRCODE_UNDEFINED_FILE,
+ (errcode(ERRCODE_UNDEFINED_FILE),
errmsg("renaming \"%s\" to \"%s\" was reverted",
fn2, fn3)));
}