Re: lazy detoasting - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: lazy detoasting
Date
Msg-id CAA4eK1J3acTsfmf8Ufyw0C_rN0OdSo07HnOixKbna+z2YKn7RA@mail.gmail.com
Whole thread Raw
In response to Re: lazy detoasting  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: lazy detoasting  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
On Wed, Apr 11, 2018 at 2:34 AM, Chapman Flack <chap@anastigmatix.net> wrote:
> On 04/10/2018 04:03 PM, Robert Haas wrote:
>
>> I suspect you want, or maybe need, to use the same snapshot as the
>> scan that retrieved the tuple containing the toasted datum.
>
> I'm sure it's worth more than that, but I don't know if it's
> implementable.
>
> If I'm a function, and the datum came to me as a parameter, I may
> have no way to determine what snapshot the enclosing query used to
> obtain the thing passed to me.
>

Before query execution, we push the active snapshot, so any time
during execution, if you get the active snapshot via
GetActiveSnapshot(), you can access it.  So, I think during a function
execution, if you use GetActiveSnapshot, you should get the snapshot
used by enclosing query.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Creation of wiki page for open items of v11
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] GSoC 2017: Foreign Key Arrays