Re: Assertion failure in smgr.c when using pg_prewarm with partitioned tables

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, Masahiro Ikeda <ikedamsh@oss.nttdata.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-05-15T10:57:27Z
Lists: pgsql-hackers
On Thu, May 15, 2025 at 6:50 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> On Thu, May 15, 2025 at 3:14 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> > How about adding a check to see whether the target relation has storage,
> > using something like RELKIND_HAS_STORAGE()?

> Yeah, that makes more sense.

+1.  FWIW, not long ago we fixed a similar Assert failure in
contrib/pg_freespacemap by verifying RELKIND_HAS_STORAGE() before
trying to access the storage (see 4623d7144).  Wondering if there are
other similar issues elsewhere in contrib ...

Thanks
Richard



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. amcheck: Improve error message for partitioned index target.

  2. Fix assertion failure in pg_prewarm() on objects without storage.

  3. Prevent assertion failure in contrib/pg_freespacemap.

  4. Don't try to open visibilitymap when analyzing a foreign table