Re: [GENERAL] Strange permission problem regarding pg_settings

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>, pgsql-hackers(at)postgresql(dot)org, Jan Wieck <JanWieck(at)Yahoo(dot)com>
Subject: Re: [GENERAL] Strange permission problem regarding pg_settings
Date: 2003-12-28 20:11:59
Message-ID: 3FEF390F.8050609@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
> No; it's possible for the amalgamated query to include references to
> tables that are referenced only in the original query and nowhere in the
> text of the rule. (This is obviously possible right now, since we just
> take the union of the two rtables and don't make any effort to discard
> unreferenced RTEs ... but I think it could happen even if we did discard
> unreferenced RTEs, because conditions from the original query get pushed
> into the rule and might reference tables that the rule text doesn't
> mention.) Checking such tables for rule-owner access would be wrong;
> they have to be checked for access by the rule caller.

OK, so the permission check performed on the original query RTEs, while
executing the rule query is:

1) redundant for non-INSTEAD cases
and
2) wrong if the original query and rule query are different modes

The patch at the root of this discussion eliminates both issues, but
leaves us with no check at all in the INSTEAD case. Is there any way to
do the permission checks on the original query in the INSTEAD case, even
though the query itself will never be executed?

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas 2003-12-28 20:17:27 what about uniqueness of inherited primary keys
Previous Message Tony 2003-12-28 19:25:07 Re: Is my MySQL Gaining ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-12-28 20:41:59 Re: [GENERAL] Strange permission problem regarding pg_settings
Previous Message Ramanujam H S Iyengar 2003-12-28 20:07:53 How to get oprname ??