Re: lazy detoasting - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: lazy detoasting
Date
Msg-id 313e030c-392b-53cd-1546-522bb7cb9f57@2ndquadrant.com
Whole thread Raw
In response to Re: lazy detoasting  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: lazy detoasting  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Is there a memory leak in commit 8561e48?
Next
From: Tom Lane
Date:
Subject: Re: "could not reattach to shared memory" on buildfarm member dory