mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Per-column collation support
This adds collation support for columns and domains, a COLLATE clause to override it per expression, and B-tree index support. Peter Eisentraut reviewed by Pavel Stehule, Itagaki Takahiro, Robert Haas, Noah Misch
This commit is contained in:
@ -862,11 +862,13 @@ examine_attribute(Relation onerel, int attnum, Node *index_expr)
|
||||
{
|
||||
stats->attrtypid = exprType(index_expr);
|
||||
stats->attrtypmod = exprTypmod(index_expr);
|
||||
stats->attrcollation = exprCollation(index_expr);
|
||||
}
|
||||
else
|
||||
{
|
||||
stats->attrtypid = attr->atttypid;
|
||||
stats->attrtypmod = attr->atttypmod;
|
||||
stats->attrcollation = attr->attcollation;
|
||||
}
|
||||
|
||||
typtuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(stats->attrtypid));
|
||||
@ -1929,6 +1931,7 @@ compute_minimal_stats(VacAttrStatsP stats,
|
||||
track_cnt = 0;
|
||||
|
||||
fmgr_info(mystats->eqfunc, &f_cmpeq);
|
||||
fmgr_info_collation(stats->attrcollation, &f_cmpeq);
|
||||
|
||||
for (i = 0; i < samplerows; i++)
|
||||
{
|
||||
@ -2250,6 +2253,7 @@ compute_scalar_stats(VacAttrStatsP stats,
|
||||
|
||||
SelectSortFunction(mystats->ltopr, false, &cmpFn, &cmpFlags);
|
||||
fmgr_info(cmpFn, &f_cmpfn);
|
||||
fmgr_info_collation(stats->attrcollation, &f_cmpfn);
|
||||
|
||||
/* Initial scan to find sortable values */
|
||||
for (i = 0; i < samplerows; i++)
|
||||
|
Reference in New Issue
Block a user