Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2186b60

Browse files
committed
Clean up partcollation handling for OID 0.
Consistent with what we do for indexes, we shouldn't try to recorddependencies on collation OID 0 or the default collation OID (whichis pinned). Also, the fact that indcollation and partcollation cancontain zero OIDs when the data type is not collatable should bedocumented.Amit Langote, per a complaint from me.Discussion:http://postgr.es/m/CA+Tgmoba5mtPgM3NKfG06vv8na5gGbVOj0h4zvivXQwLw8wXXQ@mail.gmail.com
1 parent0f33ee0 commit2186b60

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

‎doc/src/sgml/catalogs.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3783,7 +3783,8 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</>:<replaceable>&lt;salt&gt;<
37833783
<entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
37843784
<entry>
37853785
For each column in the index key, this contains the OID of the
3786-
collation to use for the index.
3786+
the collation to use for the index, or zero if the column is not
3787+
of a collatable data type.
37873788
</entry>
37883789
</row>
37893790

@@ -4770,7 +4771,8 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</>:<replaceable>&lt;salt&gt;<
47704771
<entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
47714772
<entry>
47724773
For each column in the partition key, this contains the OID of the
4773-
the collation to use for partitioning.
4774+
the collation to use for partitioning, or zero if the column is not
4775+
of a collatable data type.
47744776
</entry>
47754777
</row>
47764778

‎src/backend/catalog/heap.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,9 +3160,14 @@ StorePartitionKey(Relation rel,
31603160

31613161
recordDependencyOn(&myself,&referenced,DEPENDENCY_NORMAL);
31623162

3163-
referenced.classId=CollationRelationId;
3164-
referenced.objectId=partcollation[i];
3165-
referenced.objectSubId=0;
3163+
/* The default collation is pinned, so don't bother recording it */
3164+
if (OidIsValid(partcollation[i])&&
3165+
partcollation[i]!=DEFAULT_COLLATION_OID)
3166+
{
3167+
referenced.classId=CollationRelationId;
3168+
referenced.objectId=partcollation[i];
3169+
referenced.objectSubId=0;
3170+
}
31663171

31673172
recordDependencyOn(&myself,&referenced,DEPENDENCY_NORMAL);
31683173
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp