summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAlvaro Herrera2019-01-04 17:51:17 +0000
committerAlvaro Herrera2019-01-04 17:51:17 +0000
commit807ae415c54628ade937cb209f0fc9913e6b0cf5 (patch)
treedcf79661ba99a6aded5baa8b87751da51bdda125 /src/include
parentdf5be63763f82c5cd1b7f8af702b2e20f7d282aa (diff)
Don't create relfilenode for relations without storage
Some relation kinds had relfilenode set to some non-zero value, but apparently the actual files did not really exist because creation was prevented elsewhere. Get rid of the phony pg_class.relfilenode values. Catversion bumped, but only because the sanity_test check will fail if run in a system initdb'd with the previous version. Reviewed-by: Kyotaro HORIGUCHI, Michael Paquier Discussion: https://postgr.es/m/20181206215552.fm2ypuxq6nhpwjuc@alvherre.pgsql
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/utils/rel.h9
2 files changed, 5 insertions, 6 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index d2a49b04f40..7b3c88a1385 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201901031
+#define CATALOG_VERSION_NO 201901041
#endif
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index a7c3aa95c27..bc20950cc8a 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -450,13 +450,12 @@ typedef struct ViewOptions
/*
* RelationIsMapped
- * True if the relation uses the relfilenode map.
- *
- * NB: this is only meaningful for relkinds that have storage, else it
- * will misleadingly say "true".
+ * True if the relation uses the relfilenode map. Note multiple eval
+ * of argument!
*/
#define RelationIsMapped(relation) \
- ((relation)->rd_rel->relfilenode == InvalidOid)
+ (RELKIND_HAS_STORAGE((relation)->rd_rel->relkind) && \
+ ((relation)->rd_rel->relfilenode == InvalidOid))
/*
* RelationOpenSmgr