Hi,
     I apologize for the issue in patches v2 and v3. They contained a bug
that caused an error when collid == 0. This has now been fixed.

For example:
xman7=# select * from pg_catalog.pg_attribute where attrelid = 16418;
ERROR:  cache lookup failed for collation 0
xman7=# 

DROP TABLE IF EXISTS char_stats_1;
CREATE TABLE char_stats_1 (c "char");

INSERT INTO char_stats_1
SELECT v::"char"
FROM unnest(array['I','S','c','i','m','p','r','t','v']) AS v,
     generate_series(1, CASE WHEN v IN ('i','v','r','t') THEN 50 ELSE 1 END);

analyze char_stats_1;

select * from char_stats_1 where c = 'C';
return error:
ERROR:  cache lookup failed for collation 0

regards,
--
ZizhuanLiu (X-MAN) 
[email protected]

Attachment: v4-0001-Fix-var_eq_const-sum-selectivity-of-all-matching-.patch
Description: Binary data

Reply via email to