pg_class_ownercheck() in EnableDisableRule()

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: sfrost(at)snowman(dot)net
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: pg_class_ownercheck() in EnableDisableRule()
Date: 2009-09-18 02:35:16
Message-ID: 4AB2F1E4.5030900@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I found a strange checks in the native database privilege stuff.

The EnableDisableRule() calls pg_class_ownercheck() to check
the ownership of the relation which has a rule to be turned
on/off.

Only ATExecEnableDisableRule() calls the EnableDisableRule(),
and only ATExecCmd() calls the ATExecEnableDisableRule()
with AT_EnableRule, AT_EnableAlwaysRule, AT_EnableReplicaRule
and AT_DisableRule.

However, ATPrepCmd() already checks ownership of the target
relation using ATSimplePermissions(), so the pg_class_ownercheck()
at the EnableDisableRule() always returns true.

I replaced the checks by the abstraction of ac_rule_toggle()
in my patch. However, it may be better to remove the checks simply.

Thanks,
--
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-09-18 02:44:40 Re: Patch for 8.5, transformationHook
Previous Message Itagaki Takahiro 2009-09-18 01:47:39 Re: FSM search modes