aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/arrayfuncs.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2020-11-04 07:47:06 +0100
committerPeter Eisentraut <peter@eisentraut.org>2020-11-04 12:46:52 +0100
commitea9087938131ae0da822ccb96c2d8dc71c177f53 (patch)
tree84a383ae95d478dd84c22695334582049bf93f9b /src/backend/utils/adt/arrayfuncs.c
parent55416b26a98fcf354af88cdd27fc2e045453b68a (diff)
downloadpostgresql-ea9087938131ae0da822ccb96c2d8dc71c177f53.tar.gz
postgresql-ea9087938131ae0da822ccb96c2d8dc71c177f53.zip
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 <hlinnaka@iki.fi> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/32c1fdae-95c6-5dc6-058a-a90330a3b621%40enterprisedb.com
Diffstat (limited to 'src/backend/utils/adt/arrayfuncs.c')
-rw-r--r--src/backend/utils/adt/arrayfuncs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c
index 8fcdf829229..94c429684cb 100644
--- a/src/backend/utils/adt/arrayfuncs.c
+++ b/src/backend/utils/adt/arrayfuncs.c
@@ -4046,7 +4046,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);