pgsql-fix-enable_disable_rule.3.patch
application/octect-stream
Filename: pgsql-fix-enable_disable_rule.3.patch
Type: application/octect-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| src/backend/rewrite/rewriteDefine.c | 6 | 10 |
Index: base/src/backend/rewrite/rewriteDefine.c
===================================================================
*** base/src/backend/rewrite/rewriteDefine.c (revision 2559)
--- base/src/backend/rewrite/rewriteDefine.c (working copy)
*************** setRuleCheckAsUser_Query(Query *qry, Oid
*** 664,669 ****
--- 664,675 ----
/*
* Change the firing semantics of an existing rule.
+ *
+ * Note that this function applied its own permission checks prior to the
+ * v8.5 relase. But, currently, it had gone because of its redundancy.
+ * This operation needs identical privileges to alter properties of the
+ * table owning the rewrite rules to be modified. All the code path of
+ * this function already checks it in the ATPrepCmd().
*/
void
EnableDisableRule(Relation rel, const char *rulename,
*************** EnableDisableRule(Relation rel, const ch
*** 671,677 ****
{
Relation pg_rewrite_desc;
Oid owningRel = RelationGetRelid(rel);
- Oid eventRelationOid;
HeapTuple ruletup;
bool changed = false;
--- 677,682 ----
*************** EnableDisableRule(Relation rel, const ch
*** 690,704 ****
rulename, get_rel_name(owningRel))));
/*
- * Verify that the user has appropriate permissions.
- */
- eventRelationOid = ((Form_pg_rewrite) GETSTRUCT(ruletup))->ev_class;
- Assert(eventRelationOid == owningRel);
- if (!pg_class_ownercheck(eventRelationOid, GetUserId()))
- aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_CLASS,
- get_rel_name(eventRelationOid));
-
- /*
* Change ev_enabled if it is different from the desired new state.
*/
if (DatumGetChar(((Form_pg_rewrite) GETSTRUCT(ruletup))->ev_enabled) !=
--- 695,700 ----