Re: Why we panic in pglz_decompress

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why we panic in pglz_decompress
Date: 2008-02-29 15:08:05
Message-ID: 47C81FD5.9000406@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-02-29 15:52:09 Re: Why we panic in pglz_decompress
Previous Message Sergey Burladyan 2008-02-29 14:57:27 bug or not bug, xmlvalidate(xml, text) can read and show one line from file