Re: row based security ... was Different views with same

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marc Munro <marc(at)bloodnok(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: row based security ... was Different views with same
Date: 2002-01-21 22:04:11
Message-ID: 11622.1011650651@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marc Munro <marc(at)bloodnok(dot)com> writes:
> Does this mean that all querytree permission checking is done at query
> build time? (I'm still trying to grok the source code in this area).

No, it's done at executor startup (look in execMain.c, IIRC). The rule
rewriter does mark rangetable entries to tell the executor how to do the
checking --- so, in essence, we can tell whether a rangetable entry came
from the rule text or from the original query text. But we don't make
such distinctions for elements of expressions.

> True suid functions are probably a better idea but then we need to be
> able to limit who can execute such functions.

IIRC, call-permissions for functions are also part of the change Peter
has been muttering about.

> I don't fully understand the issue with rewritten expressions being
> arbitrary combinations of clauses from the rule and the users original
> query. Isn't each clause its own node (allowing us to determine whether
> the function should be called in the user's or rule-owner's context) or
> do I have to go and read the source some more ;-)

Yes, but (a) where did the node come from; (b) do you really want
ExecEvalExpr doing such checks? It's a hot spot already.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Haroldo Stenger 2002-01-21 22:18:15 Re: [HACKERS] PostgreSQL Licence: GNU/GPL
Previous Message Harald Massa 2002-01-21 21:47:18 Re: row based security ... was Different views with same name for