@@ -351,7 +351,6 @@ ConstructTupleDescriptor(Relation heapRelation,
351
351
to -> atthasdef = false;
352
352
to -> attislocal = true;
353
353
to -> attinhcount = 0 ;
354
-
355
354
to -> attcollation = collationObjectId [i ];
356
355
}
357
356
else
@@ -388,7 +387,6 @@ ConstructTupleDescriptor(Relation heapRelation,
388
387
to -> attcacheoff = -1 ;
389
388
to -> atttypmod = -1 ;
390
389
to -> attislocal = true;
391
-
392
390
to -> attcollation = collationObjectId [i ];
393
391
394
392
ReleaseSysCache (tuple );
@@ -653,6 +651,7 @@ UpdateIndexRelation(Oid indexoid,
653
651
* indexColNames: column names to use for index (List of char *)
654
652
* accessMethodObjectId: OID of index AM to use
655
653
* tableSpaceId: OID of tablespace to use
654
+ * collationObjectId: array of collation OIDs, one per index column
656
655
* classObjectId: array of index opclass OIDs, one per index column
657
656
* coloptions: array of per-index-column indoption settings
658
657
* reloptions: AM-specific options
@@ -871,7 +870,8 @@ index_create(Relation heapRelation,
871
870
* ----------------
872
871
*/
873
872
UpdateIndexRelation (indexRelationId , heapRelationId , indexInfo ,
874
- collationObjectId , classObjectId , coloptions , isprimary , is_exclusion ,
873
+ collationObjectId , classObjectId , coloptions ,
874
+ isprimary , is_exclusion ,
875
875
!deferrable ,
876
876
!concurrent );
877
877
@@ -965,9 +965,11 @@ index_create(Relation heapRelation,
965
965
}
966
966
967
967
/* Store dependency on collations */
968
+ /* The default collation is pinned, so don't bother recording it */
968
969
for (i = 0 ; i < indexInfo -> ii_NumIndexAttrs ; i ++ )
969
970
{
970
- if (OidIsValid (collationObjectId [i ]))
971
+ if (OidIsValid (collationObjectId [i ]) &&
972
+ collationObjectId [i ] != DEFAULT_COLLATION_OID )
971
973
{
972
974
referenced .classId = CollationRelationId ;
973
975
referenced .objectId = collationObjectId [i ];
@@ -2445,8 +2447,8 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
2445
2447
ivinfo .num_heap_tuples = heapRelation -> rd_rel -> reltuples ;
2446
2448
ivinfo .strategy = NULL ;
2447
2449
2448
- state .tuplesort = tuplesort_begin_datum (TIDOID ,
2449
- TIDLessOperator , InvalidOid , false,
2450
+ state .tuplesort = tuplesort_begin_datum (TIDOID , TIDLessOperator ,
2451
+ InvalidOid , false,
2450
2452
maintenance_work_mem ,
2451
2453
false);
2452
2454
state .htups = state .itups = state .tups_inserted = 0 ;
0 commit comments