Re: (Re)building index using itself or another index of the same table

2019-09-16 Thread Arseny Sher
Tomas Vondra writes: > On Thu, Sep 12, 2019 at 11:08:28AM -0400, Tom Lane wrote: >>I have exactly no faith that this fixes things enough to make such >>cases supportable. And I have no interest in opening that can of >>worms anyway. I'd rather put in some code to reject database >>accesses in

Re: (Re)building index using itself or another index of the same table

2019-09-15 Thread Tomas Vondra
On Thu, Sep 12, 2019 at 11:08:28AM -0400, Tom Lane wrote: Arseny Sher writes: A problem of similar nature can be reproduced with the following stripped-down scenario: CREATE TABLE pears(f1 int primary key, f2 int); INSERT INTO pears SELECT i, i+1 FROM generate_series(1, 100) i; CREATE OR REP

Re: (Re)building index using itself or another index of the same table

2019-09-12 Thread Tom Lane
Arseny Sher writes: > A problem of similar nature can be reproduced with the following > stripped-down scenario: > CREATE TABLE pears(f1 int primary key, f2 int); > INSERT INTO pears SELECT i, i+1 FROM generate_series(1, 100) i; > CREATE OR REPLACE FUNCTION pears_f(i int) RETURNS int LANGUAGE SQL

(Re)building index using itself or another index of the same table

2019-09-12 Thread Arseny Sher
Hi, Our customer encountered a curious scenario. They have a table with GIN index on expression, which performs multiple joins with this table itself. These joins employ another btree index for efficiency. VACUUM FULL on this table fails with error like ERROR: could not read block 3534 in file "