On Tue, Mar 28, 2017 at 10:31 PM, Pavan Deolasee
<pavan.deolasee@gmail.com> wrote:
>
> On Tue, Mar 28, 2017 at 4:05 PM, Amit Kapila <amit.kapila16@gmail.com>
> wrote:
>>
>> As asked previously, can you explain me on what basis are you
>> considering it robust? The comments on top of datumIsEqual() clearly
>> indicates the danger of using it for toasted values (Also, it will
>> probably not give the answer you want if either datum has been
>> "toasted".).
>
>
> Hmm. I don' see why the new code in recheck is unsafe. The index values
> themselves can't be toasted (IIUC), but they can be compressed.
> index_form_tuple() already untoasts any toasted heap attributes and
> compresses them if needed. So once we pass heap values via
> index_form_tuple() we should have exactly the same index values as they were
> inserted. Or am I missing something obvious here?
>
I don't think relying on datum comparison for compressed values from
heap and index is safe (even after you try to form index tuple from
heap value again during recheck) and I have mentioned one of the
hazards of doing so upthread. Do you see any place else where we rely
on comparison of compressed values?
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com