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

Commit4d5105a

Browse files
Improve error message for pg_create_subscription.
c3afe8c updated this error message, but it didn't use the newstyle established inde4d456.Reviewed-by: Tom LaneDiscussion:https://postgr.es/m/20230512203721.GA2644063%40nathanxps13.home
1 parent51b2c08 commit4d5105a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

‎src/backend/commands/subscriptioncmds.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,9 @@ CreateSubscription(ParseState *pstate, CreateSubscriptionStmt *stmt,
611611
if (!has_privs_of_role(owner,ROLE_PG_CREATE_SUBSCRIPTION))
612612
ereport(ERROR,
613613
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
614-
errmsg("must have privileges of pg_create_subscription to create subscriptions")));
614+
errmsg("permission denied to create subscription"),
615+
errdetail("Only roles with privileges of the \"%s\" role may create subscriptions.",
616+
"pg_create_subscription")));
615617

616618
/*
617619
* Since a subscription is a database object, we also check for CREATE

‎src/test/regress/expected/subscription.out

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ ERROR: subscription "regress_testsub" already exists
7979
-- fail - must be superuser
8080
SET SESSION AUTHORIZATION 'regress_subscription_user2';
8181
CREATE SUBSCRIPTION regress_testsub2 CONNECTION 'dbname=regress_doesnotexist' PUBLICATION foo WITH (connect = false);
82-
ERROR: must have privileges of pg_create_subscription to create subscriptions
82+
ERROR: permission denied to create subscription
83+
DETAIL: Only roles with privileges of the "pg_create_subscription" role may create subscriptions.
8384
SET SESSION AUTHORIZATION 'regress_subscription_user';
8485
-- fail - invalid option combinations
8586
CREATE SUBSCRIPTION regress_testsub2 CONNECTION 'dbname=regress_doesnotexist' PUBLICATION testpub WITH (connect = false, copy_data = true);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp