aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2015-04-30 16:57:05 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2015-04-30 16:57:05 -0300
commit9d396af46357df1243aff4a9ca4f4987e4fe6024 (patch)
treeda99dbb108c8af7abbf9d0b4d16a11eee637181e /src
parent924bcf4f16d54c55310b28f77686608684734f42 (diff)
downloadpostgresql-9d396af46357df1243aff4a9ca4f4987e4fe6024.tar.gz
postgresql-9d396af46357df1243aff4a9ca4f4987e4fe6024.zip
Fix up some loose ends for CURRENT_USER as RoleSpec
In commit 31eae6028eca4, some documents were not updated to show the new capability; fix that. Also, the error message you get when CURRENT_USER and SESSION_USER are used in a context that doesn't accept them could be clearer about it being a problem only in those contexts; so add the word "here". Author: Kyotaro HORIGUCHI His patch submission also included changes to GRANT/REVOKE, but those seemed more controversial, so I left them out. We can reconsider these changes later.
Diffstat (limited to 'src')
-rw-r--r--src/backend/parser/gram.y4
-rw-r--r--src/test/regress/expected/rolenames.out4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 962a69d22a6..0180530a309 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -13216,13 +13216,13 @@ RoleId: RoleSpec
case ROLESPEC_SESSION_USER:
ereport(ERROR,
(errcode(ERRCODE_RESERVED_NAME),
- errmsg("%s cannot be used as a role name",
+ errmsg("%s cannot be used as a role name here",
"SESSION_USER"),
parser_errposition(@1)));
case ROLESPEC_CURRENT_USER:
ereport(ERROR,
(errcode(ERRCODE_RESERVED_NAME),
- errmsg("%s cannot be used as a role name",
+ errmsg("%s cannot be used as a role name here",
"CURRENT_USER"),
parser_errposition(@1)));
}
diff --git a/src/test/regress/expected/rolenames.out b/src/test/regress/expected/rolenames.out
index 1879337ea0d..8f88c025e8f 100644
--- a/src/test/regress/expected/rolenames.out
+++ b/src/test/regress/expected/rolenames.out
@@ -43,7 +43,7 @@ CREATE ROLE "current_user";
CREATE ROLE "session_user";
CREATE ROLE "user";
CREATE ROLE current_user; -- error
-ERROR: CURRENT_USER cannot be used as a role name
+ERROR: CURRENT_USER cannot be used as a role name here
LINE 1: CREATE ROLE current_user;
^
CREATE ROLE current_role; -- error
@@ -51,7 +51,7 @@ ERROR: syntax error at or near "current_role"
LINE 1: CREATE ROLE current_role;
^
CREATE ROLE session_user; -- error
-ERROR: SESSION_USER cannot be used as a role name
+ERROR: SESSION_USER cannot be used as a role name here
LINE 1: CREATE ROLE session_user;
^
CREATE ROLE user; -- error