@@ -289,34 +289,27 @@ hashtext(PG_FUNCTION_ARGS)
289
289
}
290
290
else
291
291
{
292
- #ifdef USE_ICU
293
- if (mylocale -> provider == COLLPROVIDER_ICU )
294
- {
295
- Size bsize , rsize ;
296
- char * buf ;
297
- const char * keydata = VARDATA_ANY (key );
298
- size_t keylen = VARSIZE_ANY_EXHDR (key );
299
-
300
- bsize = pg_strnxfrm (NULL , 0 , keydata , keylen , mylocale );
301
- buf = palloc (bsize + 1 );
302
-
303
- rsize = pg_strnxfrm (buf , bsize + 1 , keydata , keylen , mylocale );
304
- if (rsize != bsize )
305
- elog (ERROR , "pg_strnxfrm() returned unexpected result" );
306
-
307
- /*
308
- * In principle, there's no reason to include the terminating NUL
309
- * character in the hash, but it was done before and the behavior
310
- * must be preserved.
311
- */
312
- result = hash_any ((uint8_t * ) buf , bsize + 1 );
313
-
314
- pfree (buf );
315
- }
316
- else
317
- #endif
318
- /* shouldn't happen */
319
- elog (ERROR , "unsupported collprovider: %c" , mylocale -> provider );
292
+ Size bsize , rsize ;
293
+ char * buf ;
294
+ const char * keydata = VARDATA_ANY (key );
295
+ size_t keylen = VARSIZE_ANY_EXHDR (key );
296
+
297
+
298
+ bsize = pg_strnxfrm (NULL , 0 , keydata , keylen , mylocale );
299
+ buf = palloc (bsize + 1 );
300
+
301
+ rsize = pg_strnxfrm (buf , bsize + 1 , keydata , keylen , mylocale );
302
+ if (rsize != bsize )
303
+ elog (ERROR , "pg_strnxfrm() returned unexpected result" );
304
+
305
+ /*
306
+ * In principle, there's no reason to include the terminating NUL
307
+ * character in the hash, but it was done before and the behavior
308
+ * must be preserved.
309
+ */
310
+ result = hash_any ((uint8_t * ) buf , bsize + 1 );
311
+
312
+ pfree (buf );
320
313
}
321
314
322
315
/* Avoid leaking memory for toasted inputs */
@@ -350,35 +343,27 @@ hashtextextended(PG_FUNCTION_ARGS)
350
343
}
351
344
else
352
345
{
353
- #ifdef USE_ICU
354
- if (mylocale -> provider == COLLPROVIDER_ICU )
355
- {
356
- Size bsize , rsize ;
357
- char * buf ;
358
- const char * keydata = VARDATA_ANY (key );
359
- size_t keylen = VARSIZE_ANY_EXHDR (key );
360
-
361
- bsize = pg_strnxfrm (NULL , 0 , keydata , keylen , mylocale );
362
- buf = palloc (bsize + 1 );
363
-
364
- rsize = pg_strnxfrm (buf , bsize + 1 , keydata , keylen , mylocale );
365
- if (rsize != bsize )
366
- elog (ERROR , "pg_strnxfrm() returned unexpected result" );
367
-
368
- /*
369
- * In principle, there's no reason to include the terminating NUL
370
- * character in the hash, but it was done before and the behavior
371
- * must be preserved.
372
- */
373
- result = hash_any_extended ((uint8_t * ) buf , bsize + 1 ,
374
- PG_GETARG_INT64 (1 ));
375
-
376
- pfree (buf );
377
- }
378
- else
379
- #endif
380
- /* shouldn't happen */
381
- elog (ERROR , "unsupported collprovider: %c" , mylocale -> provider );
346
+ Size bsize , rsize ;
347
+ char * buf ;
348
+ const char * keydata = VARDATA_ANY (key );
349
+ size_t keylen = VARSIZE_ANY_EXHDR (key );
350
+
351
+ bsize = pg_strnxfrm (NULL , 0 , keydata , keylen , mylocale );
352
+ buf = palloc (bsize + 1 );
353
+
354
+ rsize = pg_strnxfrm (buf , bsize + 1 , keydata , keylen , mylocale );
355
+ if (rsize != bsize )
356
+ elog (ERROR , "pg_strnxfrm() returned unexpected result" );
357
+
358
+ /*
359
+ * In principle, there's no reason to include the terminating NUL
360
+ * character in the hash, but it was done before and the behavior
361
+ * must be preserved.
362
+ */
363
+ result = hash_any_extended ((uint8_t * ) buf , bsize + 1 ,
364
+ PG_GETARG_INT64 (1 ));
365
+
366
+ pfree (buf );
382
367
}
383
368
384
369
PG_FREE_IF_COPY (key , 0 );
0 commit comments