Re: more RLS oversights

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Joe Conway <joe(dot)conway(at)crunchydata(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: more RLS oversights
Date: 2015-07-29 09:41:34
Message-ID: CAEZATCVAKw0SgW88e_AxiVE6em3H-6r9QTeJRJwFHU-K6EXb8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29 July 2015 at 05:02, Joe Conway <joe(dot)conway(at)crunchydata(dot)com> wrote:
> On 07/03/2015 10:03 AM, Noah Misch wrote:
>> (7) Using an aggregate function in a policy predicate elicits an inapposite
>> error message due to use of EXPR_KIND_WHERE for parse analysis. Need a new
>> ParseExprKind. Test case:
>
> Patch attached. Comments?
>

I don't think there is any point in adding the new function
transformPolicyClause(), which is identical to transformWhereClause().
You can just use transformWhereClause() with EXPR_KIND_POLICY. It's
already used for lots of other expression kinds.

There are a couple of places in test_rls_hooks.c that also need updating.

I think that check_agglevels_and_constraints() and
transformWindowFuncCall() could be made to emit more targeted error
messages for EXPR_KIND_POLICY, for example "aggregate functions are
not allowed in policy USING and WITH CHECK expressions".

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-07-29 10:41:36 Re: Don'st start streaming after creating a slot in pg_receivexlog
Previous Message Shulgin, Oleksandr 2015-07-29 09:40:30 Re: Don'st start streaming after creating a slot in pg_receivexlog