Re: Fix brin_form_tuple to properly detoast data

2020-11-06 Thread Tomas Vondra
On Thu, 5 Nov 2020 18:16:04 -0300 Alvaro Herrera wrote: > On 2020-Nov-05, Tomas Vondra wrote: > > > On 11/5/20 6:17 PM, Alvaro Herrera wrote: > > > > There are recent changes in vacuum for temp tables (commit > > > 94bc27b57680?) that would maybe make this stable enough, without > > > having

Re: Fix brin_form_tuple to properly detoast data

2020-11-05 Thread Alvaro Herrera
On 2020-Nov-05, Tomas Vondra wrote: > On 11/5/20 6:17 PM, Alvaro Herrera wrote: > > There are recent changes in vacuum for temp tables (commit 94bc27b57680?) > > that would maybe make this stable enough, without having to have the CIC > > there. At least, I tried it locally a few times and it ap

Re: Fix brin_form_tuple to properly detoast data

2020-11-05 Thread Tomas Vondra
On 11/5/20 6:17 PM, Alvaro Herrera wrote: On 2020-Nov-04, Tomas Vondra wrote: The first test is fairly trivial - it simply builds index on toasted data and then shows how an insert and select fail. There's a caveat, that this requires a DELETE + VACUUM, and the VACUUM actually has to cleanup

Re: Fix brin_form_tuple to properly detoast data

2020-11-05 Thread Alvaro Herrera
On 2020-Nov-04, Tomas Vondra wrote: > The first test is fairly trivial - it simply builds index on toasted data > and then shows how an insert and select fail. There's a caveat, that this > requires a DELETE + VACUUM, and the VACUUM actually has to cleanup the rows. > So there must be no concurren

Re: Fix brin_form_tuple to properly detoast data

2020-11-04 Thread Tomas Vondra
On 11/4/20 2:05 AM, Tomas Vondra wrote: Hi, As pointed out in [1], BRIN is not properly handling toasted data, which may easily lead to index tuples referencing TOAST-ed values. Which is clearly wrong - it's trivial to trigger failues after a DELETE. Attached is a patch that aims to fix this -

Fix brin_form_tuple to properly detoast data

2020-11-03 Thread Tomas Vondra
Hi, As pointed out in [1], BRIN is not properly handling toasted data, which may easily lead to index tuples referencing TOAST-ed values. Which is clearly wrong - it's trivial to trigger failues after a DELETE. Attached is a patch that aims to fix this - AFAIK the brin_form_tuple was simply miss