mirror of
https://github.com/postgres/postgres.git
synced 2025-05-01 01:04:50 +03:00
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
This commit is contained in:
parent
811af9786b
commit
fefa76f70f
@ -2641,8 +2641,6 @@ string_to_privilege(const char *privname)
|
|||||||
return ACL_ALTER_SYSTEM;
|
return ACL_ALTER_SYSTEM;
|
||||||
if (strcmp(privname, "maintain") == 0)
|
if (strcmp(privname, "maintain") == 0)
|
||||||
return ACL_MAINTAIN;
|
return ACL_MAINTAIN;
|
||||||
if (strcmp(privname, "rule") == 0)
|
|
||||||
return 0; /* ignore old RULE privileges */
|
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||||
errmsg("unrecognized privilege type \"%s\"", privname)));
|
errmsg("unrecognized privilege type \"%s\"", privname)));
|
||||||
|
@ -341,9 +341,6 @@ aclparse(const char *s, AclItem *aip, Node *escontext)
|
|||||||
case ACL_MAINTAIN_CHR:
|
case ACL_MAINTAIN_CHR:
|
||||||
read = ACL_MAINTAIN;
|
read = ACL_MAINTAIN;
|
||||||
break;
|
break;
|
||||||
case 'R': /* ignore old RULE privileges */
|
|
||||||
read = 0;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ereturn(escontext, NULL,
|
ereturn(escontext, NULL,
|
||||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
@ -1639,7 +1636,6 @@ makeaclitem(PG_FUNCTION_ARGS)
|
|||||||
{"SET", ACL_SET},
|
{"SET", ACL_SET},
|
||||||
{"ALTER SYSTEM", ACL_ALTER_SYSTEM},
|
{"ALTER SYSTEM", ACL_ALTER_SYSTEM},
|
||||||
{"MAINTAIN", ACL_MAINTAIN},
|
{"MAINTAIN", ACL_MAINTAIN},
|
||||||
{"RULE", 0}, /* ignore old RULE privileges */
|
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2063,8 +2059,6 @@ convert_table_priv_string(text *priv_type_text)
|
|||||||
{"TRIGGER WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_TRIGGER)},
|
{"TRIGGER WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_TRIGGER)},
|
||||||
{"MAINTAIN", ACL_MAINTAIN},
|
{"MAINTAIN", ACL_MAINTAIN},
|
||||||
{"MAINTAIN WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_MAINTAIN)},
|
{"MAINTAIN WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_MAINTAIN)},
|
||||||
{"RULE", 0}, /* ignore old RULE privileges */
|
|
||||||
{"RULE WITH GRANT OPTION", 0},
|
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1422,15 +1422,6 @@ from (select oid from pg_roles where rolname = current_user) as t2;
|
|||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- 'rule' privilege no longer exists, but for backwards compatibility
|
|
||||||
-- has_table_privilege still recognizes the keyword and says FALSE
|
|
||||||
select has_table_privilege(current_user,t1.oid,'rule')
|
|
||||||
from (select oid from pg_class where relname = 'pg_authid') as t1;
|
|
||||||
has_table_privilege
|
|
||||||
---------------------
|
|
||||||
f
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
select has_table_privilege(current_user,t1.oid,'references')
|
select has_table_privilege(current_user,t1.oid,'references')
|
||||||
from (select oid from pg_class where relname = 'pg_authid') as t1;
|
from (select oid from pg_class where relname = 'pg_authid') as t1;
|
||||||
has_table_privilege
|
has_table_privilege
|
||||||
|
@ -1004,10 +1004,6 @@ from (select oid from pg_roles where rolname = current_user) as t2;
|
|||||||
select has_table_privilege(t2.oid,'pg_authid','delete')
|
select has_table_privilege(t2.oid,'pg_authid','delete')
|
||||||
from (select oid from pg_roles where rolname = current_user) as t2;
|
from (select oid from pg_roles where rolname = current_user) as t2;
|
||||||
|
|
||||||
-- 'rule' privilege no longer exists, but for backwards compatibility
|
|
||||||
-- has_table_privilege still recognizes the keyword and says FALSE
|
|
||||||
select has_table_privilege(current_user,t1.oid,'rule')
|
|
||||||
from (select oid from pg_class where relname = 'pg_authid') as t1;
|
|
||||||
select has_table_privilege(current_user,t1.oid,'references')
|
select has_table_privilege(current_user,t1.oid,'references')
|
||||||
from (select oid from pg_class where relname = 'pg_authid') as t1;
|
from (select oid from pg_class where relname = 'pg_authid') as t1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user