Re: Index-only scan for btree_gist turns bpchar to char

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Japin Li <japinli@hotmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, pgsql-hackers@lists.postgresql.org
Date: 2022-01-05T16:34:05Z
Lists: pgsql-hackers
Japin Li <japinli@hotmail.com> writes:
> Here is a patch for POC testing.

This is certainly not right.  You've made gbt_bpchar_consistent
work identically to gbt_text_consistent, but it needs to implement
a test equivalent to bpchareq, ie ignore trailing spaces in both
inputs.

The minimum-effort fix would be to apply rtrim1 to both strings
in gbt_bpchar_consistent, but I wonder if we can improve on that
by pushing the ignore-trailing-spaces behavior further down.
I didn't look yet at whether gbt_var_consistent can support
any type-specific behavior.

			regards, tom lane



Commits

  1. Fix results of index-only scans on btree_gist char(N) indexes.