It's harmless, visibilitymap_count() returns 0 if the file doesn't
exist. But it's also very pointless. I noticed this when I added an
assertion in smgropen() that the relnumber is valid.
Discussion: https://www.postgresql.org/message-id/
621a52fd-3cd8-4f5d-a561-
d510b853bbaf@iki.fi
{
BlockNumber relallvisible;
- visibilitymap_count(onerel, &relallvisible, NULL);
+ if (RELKIND_HAS_STORAGE(onerel->rd_rel->relkind))
+ visibilitymap_count(onerel, &relallvisible, NULL);
+ else
+ relallvisible = 0;
/* Update pg_class for table relation */
vac_update_relstats(onerel,
SMgrRelation reln;
bool found;
+ Assert(RelFileNumberIsValid(rlocator.relNumber));
+
if (SMgrRelationHash == NULL)
{
/* First time through: initialize the hash table */