Re: BUG #17669: Invalid TOAST pointer in PL/pgSQL variable - Mailing list pgsql-bugs

From Sergey Shinderuk
Subject Re: BUG #17669: Invalid TOAST pointer in PL/pgSQL variable
Date
Msg-id cf30bc3d-fc00-351b-2c1f-f24418881ccb@postgrespro.ru
Whole thread Raw
In response to Re: BUG #17669: Invalid TOAST pointer in PL/pgSQL variable  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 28.10.2022 16:43, Tom Lane wrote:
> PG Bug reporting form <noreply@postgresql.org> writes:
>> postgres=# select f();
>> ERROR:  missing chunk number 0 for toast value 24727 in pg_toast_24722
> 
> To prevent that, every fetch into a plpgsql variable would have
> to immediately detoast the value, in case somebody did something
> as weird as dropping/truncating the table later in the function.
> That's an awfully expensive bit of protection.  We do in fact
> do it like that in procedures (more specifically, in non-atomic
> contexts), so a possible workaround for you is to make this a
> procedure not a function.  I'm disinclined to change it otherwise.
Thank you for explaining.

-- 
Sergey Shinderuk        https://postgrespro.com/




pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17669: Invalid TOAST pointer in PL/pgSQL variable
Next
From: Japin Li
Date:
Subject: Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios