Re: BUG #18256: spgGetCache() attempts to read to read invalid file for index attached to partitioned table
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-12-21T16:04:16Z
Lists: pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes: > The following query: > CREATE TABLE t(a int, b text) PARTITION BY RANGE (a); > CREATE INDEX idx ON t USING spgist(b); > SELECT * FROM t; > produces an unexpected error: > ERROR: could not open file "pg_tblspc/0/PG_16_202307071/0/0": No such file > or directory Thanks for the report. It looks like we could work around this by teaching spgGetCache to not try to get the lastUsedPages info for a partitioned index. (The rest of what it does is still valid for partitioned indexes.) I wonder though if there are any other similar bugs --- obviously, non-btree partitioned indexes haven't been tested sufficiently. > Reproduced on REL_16_STABLE (starting from 3c569049b) .. master. It should be possible to exhibit similar problems long before 3c569049b, I would guess. regards, tom lane
Commits
-
Avoid trying to fetch metapage of an SPGist partitioned index.
- cc3865150b8a 13.14 landed
- ab04c1901d0d 15.6 landed
- 903737c5bf94 17.0 landed
- 375f441bd19c 14.11 landed
- 1771ec9a8290 12.18 landed
- 0977bd64e294 16.2 landed
-
Don't try to open visibilitymap when analyzing a foreign table
- 049ef3398d05 17.0 cited