On 4/25/18 07:50, Andrew Gierth wrote:
> do $$
> declare a text;
> begin
> select f1.a into a from f1;
> delete from f1;
> commit;
> perform pg_sleep(10); -- vacuum f1 in another session while it sleeps
> call p1(a);
> end; $$;
> INFO: a: (t,t,f,"missing chunk number 0",,)
>
> (p1 in this case is using toast_item_detail() from the module I just put
> up at https://github.com/RhodiumToad/pg-toastutils to examine the value)
Is there a more self-contained way to test this? I have been trying
with something like
create table test1 (a int, b text);
insert into test1 values (1, repeat('foo', 2000));
do $$
declare
x text;
begin
select test1.b into x from test1;
delete from test1;
commit;
perform pg_sleep(10); -- vacuum test1 in another session
raise notice 'x = %', x; -- should fail
end;
$$;
But it doesn't fail.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services