icu_ext.c
/*
 * Get the UCollator object corresponding to the collation in input.
 * This UCollator is kept open by the backend and pointed to by the
 * cached pg_locale_t object.
 */
Get the UCollator object corresponding to the collation in input.
This UCollator is kept open by the backend and pointed to by the
cached pg_locale_t object.
Get the UCollator object corresponding to the collation in input . This UCollator is kept open by the backend and pointed to by the cached pg_locale_t object .
static UCollator*
ucollator_from_coll_id(Oid collid)
{
	pg_locale_t pg_locale;
	if (collid == DEFAULT_COLLATION_OID || !OidIsValid(collid))
	{
		ereport(ERROR,
				(errcode(ERRCODE_INDETERMINATE_COLLATION),
				 errmsg("could not determine which collation to use"),
				 errhint("Use the COLLATE clause to set the collation explicitly.")));
	}
	pg_locale = pg_newlocale_from_collation(collid);
	if (!pg_locale || pg_locale->provider != 'i')
	{
		ereport(ERROR,
				(errcode(ERRCODE_COLLATION_MISMATCH),
				 errmsg("the collation provider of the input string must be ICU")));
	}
	return pg_locale->info.icu.ucol;
}
static UCollator * ucollator_from_coll_id ( Oid collid ) { pg_locale_t pg_locale ; if ( collid == DEFAULT_COLLATION_OID || ! OidIsValid ( collid ) ) { ereport ( ERROR , ( errcode ( ERRCODE_INDETERMINATE_COLLATION ) , errmsg ( " " ) , errhint ( " " ) ) ) ; } pg_locale = pg_newlocale_from_collation ( collid ) ; if ( ! pg_locale || pg_locale -> provider != ' ' ) { ereport ( ERROR , ( errcode ( ERRCODE_COLLATION_MISMATCH ) , errmsg ( " " ) ) ) ; } return pg_locale -> info . icu . ucol ; }
Get the UCollator object corresponding to the collation in input.
Get the UCollator object corresponding to the collation in input .
/*
		 * If it was possible to have an ICU collation as default, we should
		 * not error out here on collid==DEFAULT_COLLATION_OID
		 * For the moment postgres doesn't support it, so it's okay.
		 */