Re: SP-GiST confusion: indexed column's type vs. index column type

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Pavel Borisov <pashkin.elfe@gmail.com>
Date: 2021-04-03T20:06:38Z
Lists: pgsql-hackers

Attachments

Here's a patch that, in addition to what I mentioned upthread,
rescinds the limitation that user-defined SPGIST opclasses can't
set the STORAGE parameter, and cleans up some residual confusion
about whether values are of the indexed type (attType) or the
storage type (leafType).  Once I'd wrapped my head around the idea
that indeed intermediate-level "reconstructed" values ought to be
of the leafType, there were fewer bugs of that sort than I thought
yesterday ... but still a nonzero number.

I've also attached a test module that exercises reconstruction
during index-only scan with leafType being meaningfully different
from attType.  I'm not quite sure whether this is worth
committing, but I'm leaning towards doing so.

			regards, tom lane

Commits

  1. Fix more confusion in SP-GiST.

  2. Fix confusion in SP-GiST between attribute type and leaf storage type.

  3. Rethink handling of pass-by-value leaf datums in SP-GiST.