Skip to content

Commit fefa76f

Browse files
committed
Remove old RULE privilege completely.
The RULE privilege for tables was removed in v8.2, but for backward compatibility, GRANT/REVOKE and privilege functions like has_table_privilege continued to accept the RULE keyword without any effect. After discussions on pgsql-hackers, it was agreed that this compatibility is no longer needed. Since it's been long enough since the deprecation, we've decided to fully remove support for RULE privilege, so GRANT/REVOKE and privilege functions will no longer accept it. Author: Fujii Masao Reviewed-by: Nathan Bossart Discussion: https://postgr.es/m/976a3581-6939-457f-b947-fc3dc836c083@oss.nttdata.com
1 parent 811af97 commit fefa76f

File tree

4 files changed

+0
-21
lines changed

4 files changed

+0
-21
lines changed

src/backend/catalog/aclchk.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,8 +2641,6 @@ string_to_privilege(const char *privname)
26412641
return ACL_ALTER_SYSTEM;
26422642
if (strcmp(privname, "maintain") == 0)
26432643
return ACL_MAINTAIN;
2644-
if (strcmp(privname, "rule") == 0)
2645-
return 0; /* ignore old RULE privileges */
26462644
ereport(ERROR,
26472645
(errcode(ERRCODE_SYNTAX_ERROR),
26482646
errmsg("unrecognized privilege type \"%s\"", privname)));

src/backend/utils/adt/acl.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,6 @@ aclparse(const char *s, AclItem *aip, Node *escontext)
341341
case ACL_MAINTAIN_CHR:
342342
read = ACL_MAINTAIN;
343343
break;
344-
case 'R': /* ignore old RULE privileges */
345-
read = 0;
346-
break;
347344
default:
348345
ereturn(escontext, NULL,
349346
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
@@ -1639,7 +1636,6 @@ makeaclitem(PG_FUNCTION_ARGS)
16391636
{"SET", ACL_SET},
16401637
{"ALTER SYSTEM", ACL_ALTER_SYSTEM},
16411638
{"MAINTAIN", ACL_MAINTAIN},
1642-
{"RULE", 0}, /* ignore old RULE privileges */
16431639
{NULL, 0}
16441640
};
16451641

@@ -2063,8 +2059,6 @@ convert_table_priv_string(text *priv_type_text)
20632059
{"TRIGGER WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_TRIGGER)},
20642060
{"MAINTAIN", ACL_MAINTAIN},
20652061
{"MAINTAIN WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_MAINTAIN)},
2066-
{"RULE", 0}, /* ignore old RULE privileges */
2067-
{"RULE WITH GRANT OPTION", 0},
20682062
{NULL, 0}
20692063
};
20702064

src/test/regress/expected/privileges.out

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,15 +1422,6 @@ from (select oid from pg_roles where rolname = current_user) as t2;
14221422
t
14231423
(1 row)
14241424

1425-
-- 'rule' privilege no longer exists, but for backwards compatibility
1426-
-- has_table_privilege still recognizes the keyword and says FALSE
1427-
select has_table_privilege(current_user,t1.oid,'rule')
1428-
from (select oid from pg_class where relname = 'pg_authid') as t1;
1429-
has_table_privilege
1430-
---------------------
1431-
f
1432-
(1 row)
1433-
14341425
select has_table_privilege(current_user,t1.oid,'references')
14351426
from (select oid from pg_class where relname = 'pg_authid') as t1;
14361427
has_table_privilege

src/test/regress/sql/privileges.sql

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,10 +1004,6 @@ from (select oid from pg_roles where rolname = current_user) as t2;
10041004
select has_table_privilege(t2.oid,'pg_authid','delete')
10051005
from (select oid from pg_roles where rolname = current_user) as t2;
10061006

1007-
-- 'rule' privilege no longer exists, but for backwards compatibility
1008-
-- has_table_privilege still recognizes the keyword and says FALSE
1009-
select has_table_privilege(current_user,t1.oid,'rule')
1010-
from (select oid from pg_class where relname = 'pg_authid') as t1;
10111007
select has_table_privilege(current_user,t1.oid,'references')
10121008
from (select oid from pg_class where relname = 'pg_authid') as t1;
10131009

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy