diff options
author | Joe Conway <mail@joeconway.com> | 2015-07-11 14:19:31 -0700 |
---|---|---|
committer | Joe Conway <mail@joeconway.com> | 2015-07-11 14:19:31 -0700 |
commit | 808ea8fc7bb259ddd810353719cac66e85a608c8 (patch) | |
tree | f665df0ac4a9e9cdacfbfccefbf5f7d7354c93e8 /src/backend/commands | |
parent | cba045b0bd25285242936fd678bc443bfd0d5b83 (diff) | |
download | postgresql-808ea8fc7bb259ddd810353719cac66e85a608c8.tar.gz postgresql-808ea8fc7bb259ddd810353719cac66e85a608c8.zip |
Add assign_expr_collations() to CreatePolicy() and AlterPolicy().
As noted by Noah Misch, CreatePolicy() and AlterPolicy() omit to call
assign_expr_collations() on the node trees. Fix the omission and add
his test case to the rowsecurity regression test.
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/policy.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/commands/policy.c b/src/backend/commands/policy.c index 11efc9f30f1..72329834a31 100644 --- a/src/backend/commands/policy.c +++ b/src/backend/commands/policy.c @@ -538,6 +538,10 @@ CreatePolicy(CreatePolicyStmt *stmt) EXPR_KIND_WHERE, "POLICY"); + /* Fix up collation information */ + assign_expr_collations(qual_pstate, qual); + assign_expr_collations(with_check_pstate, with_check_qual); + /* Open pg_policy catalog */ pg_policy_rel = heap_open(PolicyRelationId, RowExclusiveLock); @@ -681,6 +685,9 @@ AlterPolicy(AlterPolicyStmt *stmt) EXPR_KIND_WHERE, "POLICY"); + /* Fix up collation information */ + assign_expr_collations(qual_pstate, qual); + qual_parse_rtable = qual_pstate->p_rtable; free_parsestate(qual_pstate); } @@ -701,6 +708,9 @@ AlterPolicy(AlterPolicyStmt *stmt) EXPR_KIND_WHERE, "POLICY"); + /* Fix up collation information */ + assign_expr_collations(with_check_pstate, with_check_qual); + with_check_parse_rtable = with_check_pstate->p_rtable; free_parsestate(with_check_pstate); } |