Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rGLX5-00EpfD-2o for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Dec 2023 16:04:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rGLX3-00BC3c-Lg for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Dec 2023 16:04:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rGLX3-00BC3U-CU for pgsql-bugs@lists.postgresql.org; Thu, 21 Dec 2023 16:04:21 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rGLX0-00DCNN-Tx for pgsql-bugs@lists.postgresql.org; Thu, 21 Dec 2023 16:04:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3BLG4GAR666909; Thu, 21 Dec 2023 11:04:16 -0500 From: Tom Lane To: exclusion@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18256: spgGetCache() attempts to read to read invalid file for index attached to partitioned table In-reply-to: <18256-0b0e1b6e4a620f1b@postgresql.org> References: <18256-0b0e1b6e4a620f1b@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 21 Dec 2023 14:00:01 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <666907.1703174656.1@sss.pgh.pa.us> Date: Thu, 21 Dec 2023 11:04:16 -0500 Message-ID: <666908.1703174656@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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