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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Index-only scan for btree_gist turns bpchar to char
Date: 2022-01-05 16:34:05
Message-ID: 301107.1641400445@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Japin Li <japinli(at)hotmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tushar 2022-01-05 16:54:01 Re: refactoring basebackup.c
Previous Message Japin Li 2022-01-05 16:24:40 Re: Index-only scan for btree_gist turns bpchar to char