Re: Why we panic in pglz_decompress - Mailing list pgsql-hackers

From Zdenek Kotala
Subject Re: Why we panic in pglz_decompress
Date
Msg-id 47C81FD5.9000406@sun.com
Whole thread Raw
In response to Re: Why we panic in pglz_decompress  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera napsal(a):
> Zdenek Kotala wrote:
>> I'm now looking into toast code and I found following code in  
>> pglz_decompress:
>>
>> 00704     if (destsize != source->rawsize)
>> 00705         elog(destsize > source->rawsize ? FATAL : ERROR,
>> 00706              "compressed data is corrupt");
>>
>>
>> I'm surprise why we there panic?
> 
> Agreed, FATAL is too strong.
> 
>> My idea is to improve this piece of code and move error logging to  
>> callers (heap_tuple_untoast_attr() and heap_tuple_untoast_attr_slice())  
>> where we have a little bit more details (especially for external 
>> storage).
> 
> Why move it?  Just adding errcontext in the callers should be enough.

Good idea.
    thanks Zdenek


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Read-ahead and parallelism in redo recovery
Next
From: Tom Lane
Date:
Subject: Re: Why we panic in pglz_decompress