From 560564d3addcb6c54e13c1ca8bd11afafbb7ba11 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 4 Nov 2020 07:47:06 +0100 Subject: Enable hash partitioning of text arrays hash_array_extended() needs to pass PG_GET_COLLATION() to the hash function of the element type. Otherwise, the hash function of a collation-aware data type such as text will error out, since the introduction of nondeterministic collation made hash functions require a collation, too. The consequence of this is that before this change, hash partitioning using an array over text in the partition key would not work. Reviewed-by: Heikki Linnakangas Reviewed-by: Tom Lane Reviewed-by: Michael Paquier Discussion: https://www.postgresql.org/message-id/flat/32c1fdae-95c6-5dc6-058a-a90330a3b621%40enterprisedb.com --- src/backend/utils/adt/arrayfuncs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/adt/arrayfuncs.c') diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index 392445ea032..a7ea7656c75 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -4071,7 +4071,7 @@ hash_array_extended(PG_FUNCTION_ARGS) typalign = typentry->typalign; InitFunctionCallInfoData(*locfcinfo, &typentry->hash_extended_proc_finfo, 2, - InvalidOid, NULL, NULL); + PG_GET_COLLATION(), NULL, NULL); /* Loop over source data */ nitems = ArrayGetNItems(ndims, dims); -- cgit v1.2.3