Re: Allow GiST opcalsses without compress\decompres functions

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: amborodin@acm.org, Andrew Borodin <borodin@octonica.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-05-28T19:00:47Z
Lists: pgsql-hackers
Andrew Borodin <borodin@octonica.com> writes:
> I'm not expert in toasting, cube's compress does nothing while cube
> decomress does detoasting. Is this for reason?

The original input datum could be toasted --- at least to the extent of
being compressed in-line or having short header; I do not think we allow
out-of-line storage in an index.  This is OK for storage within the index,
and it would also be OK for an IOS to return the value in that form.
But the opclass's consistent function might expect to be always given an
untoasted input, in which case you'd need the decompress function to fix
that up.

Mind you, I'm not saying that this would represent good design;
datatype-specific functions that expect somebody else to have
detoasted their input seem pretty fragile.  But it might be how
cube's GIST support works.

			regards, tom lane


Commits

  1. Allow no-op GiST support functions to be omitted.

  2. Remove no-op GiST support functions in the core GiST opclasses.