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);
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);
}
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);
}
RESET SESSION AUTHORIZATION;
DROP TABLE copy_t;
--
+-- Collation support
+--
+BEGIN;
+SET row_security = force;
+CREATE TABLE coll_t (c) AS VALUES ('bar'::text);
+CREATE POLICY coll_p ON coll_t USING (c < ('foo'::text COLLATE "C"));
+ALTER TABLE coll_t ENABLE ROW LEVEL SECURITY;
+SELECT (string_to_array(polqual, ':'))[7] AS inputcollid FROM pg_policy WHERE polrelid = 'coll_t'::regclass;
+ inputcollid
+------------------
+ inputcollid 950
+(1 row)
+
+SELECT * FROM coll_t;
+ c
+-----
+ bar
+(1 row)
+
+ROLLBACK;
+--
-- Clean up objects
--
RESET SESSION AUTHORIZATION;
RESET SESSION AUTHORIZATION;
DROP TABLE copy_t;
+--
+-- Collation support
+--
+BEGIN;
+SET row_security = force;
+CREATE TABLE coll_t (c) AS VALUES ('bar'::text);
+CREATE POLICY coll_p ON coll_t USING (c < ('foo'::text COLLATE "C"));
+ALTER TABLE coll_t ENABLE ROW LEVEL SECURITY;
+SELECT (string_to_array(polqual, ':'))[7] AS inputcollid FROM pg_policy WHERE polrelid = 'coll_t'::regclass;
+SELECT * FROM coll_t;
+ROLLBACK;
+
--
-- Clean up objects
--