Re: Allow GiST opcalsses without compress\decompres functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: amborodin(at)acm(dot)org, Andrew Borodin <borodin(at)octonica(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow GiST opcalsses without compress\decompres functions
Date: 2017-05-28 19:00:47
Message-ID: 25263.1495998047@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Borodin <borodin(at)octonica(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-05-28 19:20:52 Re: Index created in BEFORE trigger not updated during INSERT
Previous Message Andrew Borodin 2017-05-28 18:51:16 Re: Allow GiST opcalsses without compress\decompres functions