From 84d514887f9ca673ae688d00f8b544e70f1ab270 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 13 Dec 2018 15:11:09 -0500 Subject: [PATCH] Fix bogus logic for skipping unnecessary partcollation dependencies. The idea here is to not call recordDependencyOn for the default collation, since we know that's pinned. But what the code actually did was to record the partition key's dependency on the opclass twice, instead. Evidently introduced by sloppy coding in commit 2186b608b. Back-patch to v10 where that came in. --- src/backend/catalog/heap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 11debaa780..651e86b71e 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -3413,7 +3413,7 @@ StorePartitionKey(Relation rel, /* Mark this relation as dependent on a few things as follows */ myself.classId = RelationRelationId; - myself.objectId = RelationGetRelid(rel);; + myself.objectId = RelationGetRelid(rel); myself.objectSubId = 0; /* Operator class and collation per key column */ @@ -3432,9 +3432,9 @@ StorePartitionKey(Relation rel, referenced.classId = CollationRelationId; referenced.objectId = partcollation[i]; referenced.objectSubId = 0; - } - recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); + recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); + } } /* -- 2.40.0