Re: more RLS oversights - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: more RLS oversights
Date
Msg-id CAEZATCVAKw0SgW88e_AxiVE6em3H-6r9QTeJRJwFHU-K6EXb8w@mail.gmail.com
Whole thread Raw
In response to Re: more RLS oversights  (Joe Conway <joe.conway@crunchydata.com>)
Responses Re: more RLS oversights  (Joe Conway <joe.conway@crunchydata.com>)
Re: more RLS oversights  (Joe Conway <joe.conway@crunchydata.com>)
List pgsql-hackers
On 29 July 2015 at 05:02, Joe Conway <joe.conway@crunchydata.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



pgsql-hackers by date:

Previous
From: "Shulgin, Oleksandr"
Date:
Subject: Re: Don'st start streaming after creating a slot in pg_receivexlog
Next
From: Andres Freund
Date:
Subject: Re: Don'st start streaming after creating a slot in pg_receivexlog