Re: lazy detoasting - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: lazy detoasting
Date
Msg-id 1bdb1e02-fc39-f2d9-61d4-18c31d800371@2ndquadrant.com
Whole thread Raw
In response to Re: lazy detoasting  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: lazy detoasting  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 5/3/18 13:03, Andrew Gierth wrote:
>>>>>> "Peter" == Peter Eisentraut <peter.eisentraut@2ndquadrant.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

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Postgres 11 release notes
Next
From: Andrew Dunstan
Date:
Subject: Re: perlcritic: Missing "return"