]> granicus.if.org Git - postgresql/commit
Fix GiST index-only scans for opclasses with different storage type.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 26 Mar 2015 21:07:52 +0000 (23:07 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 26 Mar 2015 21:07:52 +0000 (23:07 +0200)
commit55b59eda13a742f8af913734e22ecc8a21754414
tree4bbe77575d9eb2f27d0c770d07fc10095ea329f6
parent785941cdc359c6e595201ffb0df9d28f3f7173a4
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.
src/backend/access/gist/gistscan.c
src/backend/access/gist/gistutil.c
src/include/access/gist_private.h