summaryrefslogtreecommitdiff
path: root/src/backend/access/nbtree/nbtutils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-03-26 18:28:40 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-03-26 18:28:40 -0400
commit7208fae18f1fdb242b4fcced77a3b836e15ac3ec (patch)
treee857033e3c74a3f73de3e29720290ee721199df3 /src/backend/access/nbtree/nbtutils.c
parent0c9d9e8dd655fff7bcfc401e82838b8c20c16939 (diff)
Clean up cruft around collation initialization for tupdescs and scankeys.
I found actual bugs in GiST and plpgsql; the rest of this is cosmetic but meant to decrease the odds of future bugs of omission.
Diffstat (limited to 'src/backend/access/nbtree/nbtutils.c')
-rw-r--r--src/backend/access/nbtree/nbtutils.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c
index 7ee7ebeb3cb..add932d9428 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -70,7 +70,8 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
/*
* We can use the cached (default) support procs since no cross-type
- * comparison can be needed.
+ * comparison can be needed. The cached support proc entries have
+ * the right collation for the index, too.
*/
procinfo = index_getprocinfo(rel, i + 1, BTORDER_PROC);
arg = index_getattr(itup, i + 1, itupdesc, &null);
@@ -80,6 +81,7 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
(AttrNumber) (i + 1),
InvalidStrategy,
InvalidOid,
+ procinfo->fn_collation,
procinfo,
arg);
}
@@ -118,7 +120,8 @@ _bt_mkscankey_nodata(Relation rel)
/*
* We can use the cached (default) support procs since no cross-type
- * comparison can be needed.
+ * comparison can be needed. The cached support proc entries have
+ * the right collation for the index, too.
*/
procinfo = index_getprocinfo(rel, i + 1, BTORDER_PROC);
flags = SK_ISNULL | (indoption[i] << SK_BT_INDOPTION_SHIFT);
@@ -127,6 +130,7 @@ _bt_mkscankey_nodata(Relation rel)
(AttrNumber) (i + 1),
InvalidStrategy,
InvalidOid,
+ procinfo->fn_collation,
procinfo,
(Datum) 0);
}