git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 78e7e20)
De-kludge contrib/btree_gin for collations.
2011年4月22日 22:22:38 +0000 (18:22 -0400)
2011年4月22日 22:22:38 +0000 (18:22 -0400)
Using DEFAULT_COLLATION_OID in the comparePartial functions was not only
a lame hack, but outright wrong, because the compare functions for
collation-aware types were already responding to the declared index
collation. So comparePartial would have the wrong expectation about
the index's sort order, possibly leading to missing matches for prefix
searches.


diff --git a/contrib/btree_gin/btree_gin.c b/contrib/btree_gin/btree_gin.c
index 7ca153e0928930199154977deb8a29b8cfdc3da3..5c4f58b8b1f2142e730540cd125ea523da5205c8 100644 (file)
--- a/contrib/btree_gin/btree_gin.c
+++ b/contrib/btree_gin/btree_gin.c
@@ -7,7 +7,6 @@
#include "fmgr.h"
#include "access/skey.h"
-#include "catalog/pg_collation.h"
#include "utils/builtins.h"
#include "utils/bytea.h"
#include "utils/cash.h"
@@ -123,7 +122,7 @@ gin_compare_prefix_##type(PG_FUNCTION_ARGS) \
\
cmp = DatumGetInt32(DirectFunctionCall2Coll( \
TypeInfo_##type.typecmp, \
- DEFAULT_COLLATION_OID, \
+ PG_GET_COLLATION(), \
(data->strategy == BTLessStrategyNumber || \
data->strategy == BTLessEqualStrategyNumber) \
? data->datum : a, \
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /