Fix GiST index-only scans for opclasses with different storage type.
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Fix GiST index-only scans for opclasses with different storage type. We cannot use the index's tuple descriptor directly to describe the index tuples returned in an index-only scan. That's because the index might use a different datatype for the values stored on disk than the type originally indexed. As long as they were both pass-by-ref, it worked, but will not work for pass-by-value types of different sizes. I noticed this as a crash when I started hacking a patch to add fetch methods to btree_gist.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/gist/gistscan.c | modified | +27 −7 |
| src/backend/access/gist/gistutil.c | modified | +1 −1 |
| src/include/access/gist_private.h | modified | +2 −0 |