aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-01-04 14:51:17 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-01-04 14:51:17 -0300
commit807ae415c54628ade937cb209f0fc9913e6b0cf5 (patch)
treedcf79661ba99a6aded5baa8b87751da51bdda125 /src/backend/utils/cache
parentdf5be63763f82c5cd1b7f8af702b2e20f7d282aa (diff)
downloadpostgresql-807ae415c54628ade937cb209f0fc9913e6b0cf5.tar.gz
postgresql-807ae415c54628ade937cb209f0fc9913e6b0cf5.zip
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/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/relcache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index b5f5a224171..06503bc98b2 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -1253,6 +1253,10 @@ RelationBuildDesc(Oid targetRelId, bool insertIt)
static void
RelationInitPhysicalAddr(Relation relation)
{
+ /* these relations kinds never have storage */
+ if (!RELKIND_HAS_STORAGE(relation->rd_rel->relkind))
+ return;
+
if (relation->rd_rel->reltablespace)
relation->rd_node.spcNode = relation->rd_rel->reltablespace;
else