Thread: Re: [HACKERS] Document and/or remove unreachable code in tuptoaster.c from varvarlena patch

Sorry, meant to send the previous message to pgsql-patches.

Here's a version cut using cvs diff so it's usable with -p0

I added one more fixup. There was a silly test in toast_fetch_datum_slice()
which handled compressed datums. Returning a slice of a compressed datum is
nonsensical with toast since the resulting datum would be useless. I also
added an assertion in this function that the datum is external before we treat
it as a toast_pointer.

(Incidentally, I did eventually manage to construct a case to reach all the pfrees.)




--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

Attachment
Gregory Stark <stark@enterprisedb.com> writes:
> [ revised version of tuptoaster-fixup.patch ]

I've applied most of this.  I didn't like the hardwired assumption about
minimum size to compress, and anyway you had put it in a place where it
broke the intended behavior for SET STORAGE PLAIN.  I replaced it with
just a test to save palloc/pfree overhead in toast_compress_datum, which
has at least got knowledge of which PGLZ strategy is being used.

            regards, tom lane