aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-06-06 11:07:20 -0400
committerRobert Haas <rhaas@postgresql.org>2017-06-06 11:07:20 -0400
commit2186b608b3cb859fe0ec04015a5c4e4cbf69caed (patch)
tree1a2c70b47bd97c0ad34ce99fdda0c5e00b927ae9 /src
parent0f33ee0e3b7527fb0c88abf0ae8a49a9c38d9c0e (diff)
downloadpostgresql-2186b608b3cb859fe0ec04015a5c4e4cbf69caed.tar.gz
postgresql-2186b608b3cb859fe0ec04015a5c4e4cbf69caed.zip
Clean up partcollation handling for OID 0.
Consistent with what we do for indexes, we shouldn't try to record dependencies on collation OID 0 or the default collation OID (which is pinned). Also, the fact that indcollation and partcollation can contain zero OIDs when the data type is not collatable should be documented. Amit Langote, per a complaint from me. Discussion: http://postgr.es/m/CA+Tgmoba5mtPgM3NKfG06vv8na5gGbVOj0h4zvivXQwLw8wXXQ@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/heap.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 0ce94f346f5..4e5b79ef941 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -3160,9 +3160,14 @@ StorePartitionKey(Relation rel,
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
- referenced.classId = CollationRelationId;
- referenced.objectId = partcollation[i];
- referenced.objectSubId = 0;
+ /* The default collation is pinned, so don't bother recording it */
+ if (OidIsValid(partcollation[i]) &&
+ partcollation[i] != DEFAULT_COLLATION_OID)
+ {
+ referenced.classId = CollationRelationId;
+ referenced.objectId = partcollation[i];
+ referenced.objectSubId = 0;
+ }
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
}