Create new ParseExprKind for use by policy expressions.
Joe Conway <mail@joeconway.com>
Create new ParseExprKind for use by policy expressions. Policy USING and WITH CHECK expressions were using EXPR_KIND_WHERE for parse analysis, which results in inappropriate ERROR messages when the expression contains unsupported constructs such as aggregates. Create a new ParseExprKind called EXPR_KIND_POLICY and tailor the related messages to fit. Reported by Noah Misch. Reviewed by Dean Rasheed, Alvaro Herrera, and Robert Haas. Back-patch to 9.5 where RLS was introduced.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/policy.c | modified | +4 −4 |
| src/backend/parser/parse_agg.c | modified | +10 −0 |
| src/backend/parser/parse_expr.c | modified | +3 −0 |
| src/include/parser/parse_node.h | modified | +2 −1 |
| src/test/modules/test_rls_hooks/test_rls_hooks.c | modified | +2 −2 |
| src/test/regress/expected/rowsecurity.out | modified | +9 −0 |
| src/test/regress/sql/rowsecurity.sql | modified | +9 −0 |