Thread: pgsql: Create new ParseExprKind for use by policy expressions.

pgsql: Create new ParseExprKind for use by policy expressions.

From
Joe Conway
Date:
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.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/43797ed42a7c0365c9143ad6efdc566ac9d93fd8

Modified Files
--------------
src/backend/commands/policy.c                    |    8 ++++----
src/backend/parser/parse_agg.c                   |   10 ++++++++++
src/backend/parser/parse_expr.c                  |    3 +++
src/include/parser/parse_node.h                  |    3 ++-
src/test/modules/test_rls_hooks/test_rls_hooks.c |    4 ++--
src/test/regress/expected/rowsecurity.out        |    9 +++++++++
src/test/regress/sql/rowsecurity.sql             |    9 +++++++++
7 files changed, 39 insertions(+), 7 deletions(-)