get_rule_expr RelabelType node does not print COLLATE clause - Mailing list pgsql-hackers

From jian he
Subject get_rule_expr RelabelType node does not print COLLATE clause
Date
Msg-id CACJufxFtc9m6EZUr=4gpzoRGpVawqiHdYPB9YhZ5UGcRT98cfQ@mail.gmail.com
Whole thread Raw
Responses Re: get_rule_expr RelabelType node does not print COLLATE clause
List pgsql-hackers
hi.

I found in some cases, we need to print COLLATE clauses for RelabelType Node.


CREATE TABLE ttsa (c1 text[]);
CREATE COLLATION case_sensitive (provider = icu, locale = '');
explain (verbose, cost off) SELECT count(*) FROM ttsa WHERE c1 =
(array[1,2]::int[]::text[]) collate case_sensitive;
                             QUERY PLAN
--------------------------------------------------------------------
 Aggregate
   Output: count(*)
   ->  Seq Scan on public.ttsa
         Output: c1
         Filter: (ttsa.c1 = '{1,2}'::text[] COLLATE case_sensitive)
(5 rows)

PREPARE p1(int[]) AS SELECT count(*) FROM ttsa WHERE c1 = ($1::text[])
collate case_sensitive;
SET plan_cache_mode = force_generic_plan;
EXPLAIN (VERBOSE, COSTS OFF) EXECUTE p1(array[1,2]);
                     QUERY PLAN
----------------------------------------------------
 Aggregate
   Output: count(*)
   ->  Seq Scan on public.ttsa
         Output: c1
         Filter: (ttsa.c1 = (($1)::text[])::text[])
(5 rows)

should I expect the above Query plan Filter section also print out the
COLLATE clause explicitly?
like:
Filter: (ttsa.c1 = (($1)::text[])::text[] COLLATE case_sensitive)



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: index prefetching
Next
From: "Michael J. Baars"
Date:
Subject: Re: Upgrade from Fedora 40 to Fedora 42, or from PostgreSQL 16.3 to PostgreSQL 16.9