@@ -1554,7 +1554,9 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15541554#endif /* USE_WIDE_UPPER_LOWER */
15551555else
15561556{
1557+ #ifdef HAVE_LOCALE_T
15571558pg_locale_t mylocale = 0 ;
1559+ #endif
15581560char * p ;
15591561
15601562if (collid != DEFAULT_COLLATION_OID )
@@ -1570,7 +1572,9 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
15701572errmsg ("could not determine which collation to use for lower() function" ),
15711573errhint ("Use the COLLATE clause to set the collation explicitly." )));
15721574}
1575+ #ifdef HAVE_LOCALE_T
15731576mylocale = pg_newlocale_from_collation (collid );
1577+ #endif
15741578}
15751579
15761580result = pnstrdup (buff ,nbytes );
@@ -1675,7 +1679,9 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
16751679#endif /* USE_WIDE_UPPER_LOWER */
16761680else
16771681{
1682+ #ifdef HAVE_LOCALE_T
16781683pg_locale_t mylocale = 0 ;
1684+ #endif
16791685char * p ;
16801686
16811687if (collid != DEFAULT_COLLATION_OID )
@@ -1691,7 +1697,9 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
16911697errmsg ("could not determine which collation to use for upper() function" ),
16921698errhint ("Use the COLLATE clause to set the collation explicitly." )));
16931699}
1700+ #ifdef HAVE_LOCALE_T
16941701mylocale = pg_newlocale_from_collation (collid );
1702+ #endif
16951703}
16961704
16971705result = pnstrdup (buff ,nbytes );
@@ -1820,7 +1828,9 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
18201828#endif /* USE_WIDE_UPPER_LOWER */
18211829else
18221830{
1831+ #ifdef HAVE_LOCALE_T
18231832pg_locale_t mylocale = 0 ;
1833+ #endif
18241834char * p ;
18251835
18261836if (collid != DEFAULT_COLLATION_OID )
@@ -1836,7 +1846,9 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
18361846errmsg ("could not determine which collation to use for initcap() function" ),
18371847errhint ("Use the COLLATE clause to set the collation explicitly." )));
18381848}
1849+ #ifdef HAVE_LOCALE_T
18391850mylocale = pg_newlocale_from_collation (collid );
1851+ #endif
18401852}
18411853
18421854result = pnstrdup (buff ,nbytes );