Re: [HACKERS] Allow GiST opcalsses without compress\decompres functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Allow GiST opcalsses without compress\decompres functions
Date
Msg-id 25263.1495998047@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Allow GiST opcalsses without compress\decompres functions  (Andrew Borodin <borodin@octonica.com>)
Responses Re: [HACKERS] Allow GiST opcalsses without compress\decompres functions
List 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



pgsql-hackers by date:

Previous
From: Andrew Borodin
Date:
Subject: Re: [HACKERS] Allow GiST opcalsses without compress\decompres functions
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Index created in BEFORE trigger not updated during INSERT