Re: BUG #18150: The results returned by index only scan using gist index of bpchar and seqscan have difference.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ocean_li_996(at)163(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18150: The results returned by index only scan using gist index of bpchar and seqscan have difference.
Date: 2023-10-08 16:17:53
Message-ID: 3326255.1696781873@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> PostgreSQL version: 11.9

> When testing consistency between index (only) scan and seqscan, I found that
> the results returned by index only scan using gist index of bpchar and
> seqscan have difference.

This was fixed last year, in 11.15 (and releases of same date in other
branches). Per those release notes:

Fix results of index-only scans on contrib/btree_gist indexes on char(N)
columns (Tom Lane)

Index-only scans returned column values with trailing spaces removed,
which is not the expected behavior. That happened because that's how
the data was stored in the index. This fix changes the code to store
char(N) values with the expected amount of space padding. The behavior
of such an index will not change immediately unless you REINDEX it;
otherwise space-stripped values will be gradually replaced over time
during updates. Queries that do not use index-only scan plans will be
unaffected in any case.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-10-08 17:41:14 BUG #18151: pg_upgradecluster fails when column default refers to column
Previous Message PG Bug reporting form 2023-10-08 15:52:05 BUG #18150: The results returned by index only scan using gist index of bpchar and seqscan have difference.