Re: lazy detoasting

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: lazy detoasting
Date: 2018-05-11 21:17:19
Message-ID: 1bdb1e02-fc39-f2d9-61d4-18c31d800371@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/3/18 13:03, Andrew Gierth wrote:
>>>>>> "Peter" == Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
>
> Peter> The attached test fixes this issue by flattening the toast
> Peter> values before storing them into PL/pgSQL variables. It could use
> Peter> another check to see if there are other code paths that need
> Peter> similar adjustments, but I think it's the right idea in general.
>
> Uhh.
>
> What about:
> or or or ...

Here is a more complete patch. I made a call graph to get to the
bottom, literally, of how variable assignments happen in PL/pgSQL. (See
attached.) There are four leaf functions to patch up.

Also, I wrote some isolation tests to hit each of these cases. I wasn't
able to construct one for expanded_record_set_fields(), but the
principle there should be the same.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v2-0001-PL-pgSQL-Flatten-TOAST-data-in-nonatomic-context.patch text/plain 16.3 KB
plpgsql-assign.dot.png image/png 108.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2018-05-11 21:50:27 Re: perlcritic: Missing "return"
Previous Message Bruce Momjian 2018-05-11 21:06:52 Re: Postgres 11 release notes