PostgreSQL Source Code git master
formatting.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * str_tolower (const char *buff, size_t nbytes, Oid collid)
 
char * str_toupper (const char *buff, size_t nbytes, Oid collid)
 
char * str_initcap (const char *buff, size_t nbytes, Oid collid)
 
char * str_casefold (const char *buff, size_t nbytes, Oid collid)
 
char * asc_tolower (const char *buff, size_t nbytes)
 
char * asc_toupper (const char *buff, size_t nbytes)
 
char * asc_initcap (const char *buff, size_t nbytes)
 
Datum parse_datetime (text *date_txt, text *fmt, Oid collid, bool strict, Oid *typid, int32 *typmod, int *tz, struct Node *escontext)
 
bool datetime_format_has_tz (const char *fmt_str)
 

Function Documentation

◆ asc_initcap()

char * asc_initcap ( const char *  buff,
size_t  nbytes 
)

Definition at line 1931 of file formatting.c.

1932{
1933 char *result;
1934 int wasalnum = false;
1935
1936 if (!buff)
1937 return NULL;
1938
1939 result = pnstrdup(buff, nbytes);
1940
1941 for (char *p = result; *p; p++)
1942 {
1943 char c;
1944
1945 if (wasalnum)
1946 *p = c = pg_ascii_tolower((unsigned char) *p);
1947 else
1948 *p = c = pg_ascii_toupper((unsigned char) *p);
1949 /* we don't trust isalnum() here */
1950 wasalnum = ((c >= 'A' && c <= 'Z') ||
1951 (c >= 'a' && c <= 'z') ||
1952 (c >= '0' && c <= '9'));
1953 }
1954
1955 return result;
1956}
char * pnstrdup(const char *in, Size len)
Definition: mcxt.c:1770
static unsigned char pg_ascii_tolower(unsigned char ch)
Definition: port.h:188
static unsigned char pg_ascii_toupper(unsigned char ch)
Definition: port.h:177
char * c

References pg_ascii_tolower(), pg_ascii_toupper(), and pnstrdup().

Referenced by str_initcap().

◆ asc_tolower()

char * asc_tolower ( const char *  buff,
size_t  nbytes 
)

Definition at line 1887 of file formatting.c.

1888{
1889 char *result;
1890
1891 if (!buff)
1892 return NULL;
1893
1894 result = pnstrdup(buff, nbytes);
1895
1896 for (char *p = result; *p; p++)
1897 *p = pg_ascii_tolower((unsigned char) *p);
1898
1899 return result;
1900}

References pg_ascii_tolower(), and pnstrdup().

Referenced by asc_tolower_z(), str_casefold(), and str_tolower().

◆ asc_toupper()

char * asc_toupper ( const char *  buff,
size_t  nbytes 
)

Definition at line 1909 of file formatting.c.

1910{
1911 char *result;
1912
1913 if (!buff)
1914 return NULL;
1915
1916 result = pnstrdup(buff, nbytes);
1917
1918 for (char *p = result; *p; p++)
1919 *p = pg_ascii_toupper((unsigned char) *p);
1920
1921 return result;
1922}

References pg_ascii_toupper(), and pnstrdup().

Referenced by asc_toupper_z(), and str_toupper().

◆ datetime_format_has_tz()

bool datetime_format_has_tz ( const char *  fmt_str)

Definition at line 4324 of file formatting.c.

4325{
4326 bool incache;
4327 size_t fmt_len = strlen(fmt_str);
4328 int result;
4330
4331 if (fmt_len > DCH_CACHE_SIZE)
4332 {
4333 /*
4334 * Allocate new memory if format picture is bigger than static cache
4335 * and do not use cache (call parser always)
4336 */
4337 incache = false;
4338
4339 format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode));
4340
4342 DCH_suff, DCH_index, DCH_FLAG, NULL);
4343 }
4344 else
4345 {
4346 /*
4347 * Use cache buffers
4348 */
4349 DCHCacheEntry *ent = DCH_cache_fetch(fmt_str, false);
4350
4351 incache = true;
4352 format = ent->format;
4353 }
4354
4355 result = DCH_datetime_type(format);
4356
4357 if (!incache)
4358 pfree(format);
4359
4360 return result & DCH_ZONED;
4361}
static const int DCH_index[KeyWord_INDEX_SIZE]
Definition: formatting.c:984
static void parse_format(FormatNode *node, const char *str, const KeyWord *kw, const KeySuffix *suf, const int *index, uint32 flags, NUMDesc *Num)
Definition: formatting.c:1377
#define DCH_FLAG
Definition: formatting.c:98
static const KeySuffix DCH_suff[]
Definition: formatting.c:609
#define DCH_CACHE_SIZE
Definition: formatting.c:382
#define DCH_ZONED
Definition: formatting.c:1062
static int DCH_datetime_type(FormatNode *node)
Definition: formatting.c:3691
static const KeyWord DCH_keywords[]
Definition: formatting.c:813
static DCHCacheEntry * DCH_cache_fetch(const char *str, bool std)
Definition: formatting.c:3868
void pfree(void *pointer)
Definition: mcxt.c:1594
void * palloc(Size size)
Definition: mcxt.c:1365
static char format
FormatNode format[DCH_CACHE_SIZE+1]
Definition: formatting.c:392

References DCH_cache_fetch(), DCH_CACHE_SIZE, DCH_datetime_type(), DCH_FLAG, DCH_index, DCH_keywords, DCH_suff, DCH_ZONED, DCHCacheEntry::format, format, palloc(), parse_format(), and pfree().

Referenced by jspIsMutableWalker().

◆ parse_datetime()

Datum parse_datetime ( text date_txt,
text fmt,
Oid  collid,
bool  strict,
Oid typid,
int32 typmod,
int *  tz,
struct Node escontext 
)

Definition at line 4163 of file formatting.c.

4166{
4167 struct pg_tm tm;
4168 struct fmt_tz ftz;
4169 fsec_t fsec;
4170 int fprec;
4171 uint32 flags;
4172
4173 if (!do_to_timestamp(date_txt, fmt, collid, strict,
4174 &tm, &fsec, &ftz, &fprec, &flags, escontext))
4175 return (Datum) 0;
4176
4177 *typmod = fprec ? fprec : -1; /* fractional part precision */
4178
4179 if (flags & DCH_DATED)
4180 {
4181 if (flags & DCH_TIMED)
4182 {
4183 if (flags & DCH_ZONED)
4184 {
4185 TimestampTz result;
4186
4187 if (ftz.has_tz)
4188 {
4189 *tz = ftz.gmtoffset;
4190 }
4191 else
4192 {
4193 /*
4194 * Time zone is present in format string, but not in input
4195 * string. Assuming do_to_timestamp() triggers no error
4196 * this should be possible only in non-strict case.
4197 */
4198 Assert(!strict);
4199
4200 ereturn(escontext, (Datum) 0,
4201 (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
4202 errmsg("missing time zone in input string for type timestamptz")));
4203 }
4204
4205 if (tm2timestamp(&tm, fsec, tz, &result) != 0)
4206 ereturn(escontext, (Datum) 0,
4207 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4208 errmsg("timestamptz out of range")));
4209
4210 AdjustTimestampForTypmod(&result, *typmod, escontext);
4211
4212 *typid = TIMESTAMPTZOID;
4213 return TimestampTzGetDatum(result);
4214 }
4215 else
4216 {
4217 Timestamp result;
4218
4219 if (tm2timestamp(&tm, fsec, NULL, &result) != 0)
4220 ereturn(escontext, (Datum) 0,
4221 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4222 errmsg("timestamp out of range")));
4223
4224 AdjustTimestampForTypmod(&result, *typmod, escontext);
4225
4226 *typid = TIMESTAMPOID;
4227 return TimestampGetDatum(result);
4228 }
4229 }
4230 else
4231 {
4232 if (flags & DCH_ZONED)
4233 {
4234 ereturn(escontext, (Datum) 0,
4235 (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
4236 errmsg("datetime format is zoned but not timed")));
4237 }
4238 else
4239 {
4240 DateADT result;
4241
4242 /* Prevent overflow in Julian-day routines */
4244 ereturn(escontext, (Datum) 0,
4245 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4246 errmsg("date out of range: \"%s\"", text_to_cstring(date_txt))));
4247
4248 result = date2j(tm.tm_year, tm.tm_mon, tm.tm_mday) -
4250
4251 /* Now check for just-out-of-range dates */
4252 if (!IS_VALID_DATE(result))
4253 ereturn(escontext, (Datum) 0,
4254 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4255 errmsg("date out of range: \"%s\"", text_to_cstring(date_txt))));
4256
4257 *typid = DATEOID;
4258 return DateADTGetDatum(result);
4259 }
4260 }
4261 }
4262 else if (flags & DCH_TIMED)
4263 {
4264 if (flags & DCH_ZONED)
4265 {
4266 TimeTzADT *result = palloc(sizeof(TimeTzADT));
4267
4268 if (ftz.has_tz)
4269 {
4270 *tz = ftz.gmtoffset;
4271 }
4272 else
4273 {
4274 /*
4275 * Time zone is present in format string, but not in input
4276 * string. Assuming do_to_timestamp() triggers no error this
4277 * should be possible only in non-strict case.
4278 */
4279 Assert(!strict);
4280
4281 ereturn(escontext, (Datum) 0,
4282 (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
4283 errmsg("missing time zone in input string for type timetz")));
4284 }
4285
4286 if (tm2timetz(&tm, fsec, *tz, result) != 0)
4287 ereturn(escontext, (Datum) 0,
4288 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4289 errmsg("timetz out of range")));
4290
4291 AdjustTimeForTypmod(&result->time, *typmod);
4292
4293 *typid = TIMETZOID;
4294 return TimeTzADTPGetDatum(result);
4295 }
4296 else
4297 {
4298 TimeADT result;
4299
4300 if (tm2time(&tm, fsec, &result) != 0)
4301 ereturn(escontext, (Datum) 0,
4302 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4303 errmsg("time out of range")));
4304
4305 AdjustTimeForTypmod(&result, *typmod);
4306
4307 *typid = TIMEOID;
4308 return TimeADTGetDatum(result);
4309 }
4310 }
4311 else
4312 {
4313 ereturn(escontext, (Datum) 0,
4314 (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
4315 errmsg("datetime format is not dated and not timed")));
4316 }
4317}
int date2j(int year, int month, int day)
Definition: datetime.c:296
bool AdjustTimestampForTypmod(Timestamp *time, int32 typmod, Node *escontext)
Definition: timestamp.c:368
int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *result)
Definition: timestamp.c:2006
uint32_t uint32
Definition: c.h:541
Oid collid
int64 Timestamp
Definition: timestamp.h:38
int64 TimestampTz
Definition: timestamp.h:39
#define IS_VALID_DATE(d)
Definition: timestamp.h:262
int32 fsec_t
Definition: timestamp.h:41
#define IS_VALID_JULIAN(y, m, d)
Definition: timestamp.h:227
#define POSTGRES_EPOCH_JDATE
Definition: timestamp.h:235
int tm2time(struct pg_tm *tm, fsec_t fsec, TimeADT *result)
Definition: date.c:1512
int tm2timetz(struct pg_tm *tm, fsec_t fsec, int tz, TimeTzADT *result)
Definition: date.c:2359
void AdjustTimeForTypmod(TimeADT *time, int32 typmod)
Definition: date.c:1741
static Datum DateADTGetDatum(DateADT X)
Definition: date.h:72
int32 DateADT
Definition: date.h:23
static Datum TimeTzADTPGetDatum(const TimeTzADT *X)
Definition: date.h:84
int64 TimeADT
Definition: date.h:25
static Datum TimeADTGetDatum(TimeADT X)
Definition: date.h:78
int errcode(int sqlerrcode)
Definition: elog.c:863
int errmsg(const char *fmt,...)
Definition: elog.c:1080
#define ereturn(context, dummy_value,...)
Definition: elog.h:278
#define DCH_DATED
Definition: formatting.c:1060
static bool do_to_timestamp(const text *date_txt, const text *fmt, Oid collid, bool std, struct pg_tm *tm, fsec_t *fsec, struct fmt_tz *tz, int *fprec, uint32 *flags, Node *escontext)
Definition: formatting.c:4387
#define DCH_TIMED
Definition: formatting.c:1061
Assert(PointerIsAligned(start, uint64))
static struct pg_tm tm
Definition: localtime.c:104
uint64_t Datum
Definition: postgres.h:70
Definition: date.h:28
TimeADT time
Definition: date.h:29
int gmtoffset
Definition: formatting.c:456
Definition: pgtime.h:35
int tm_mday
Definition: pgtime.h:39
int tm_mon
Definition: pgtime.h:40
int tm_year
Definition: pgtime.h:41
static Datum TimestampTzGetDatum(TimestampTz X)
Definition: timestamp.h:52
static Datum TimestampGetDatum(Timestamp X)
Definition: timestamp.h:46
char * text_to_cstring(const text *t)
Definition: varlena.c:214

References AdjustTimeForTypmod(), AdjustTimestampForTypmod(), Assert(), collid, date2j(), DateADTGetDatum(), DCH_DATED, DCH_TIMED, DCH_ZONED, do_to_timestamp(), ereturn, errcode(), errmsg(), fmt_tz::gmtoffset, fmt_tz::has_tz, IS_VALID_DATE, IS_VALID_JULIAN, palloc(), POSTGRES_EPOCH_JDATE, text_to_cstring(), TimeTzADT::time, TimeADTGetDatum(), TimestampGetDatum(), TimestampTzGetDatum(), TimeTzADTPGetDatum(), tm, tm2time(), tm2timestamp(), tm2timetz(), pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.

Referenced by executeDateTimeMethod().

◆ str_casefold()

char * str_casefold ( const char *  buff,
size_t  nbytes,
Oid  collid 
)

Definition at line 1818 of file formatting.c.

1819{
1820 char *result;
1821 pg_locale_t mylocale;
1822
1823 if (!buff)
1824 return NULL;
1825
1826 if (!OidIsValid(collid))
1827 {
1828 /*
1829 * This typically means that the parser could not resolve a conflict
1830 * of implicit collations, so report it that way.
1831 */
1832 ereport(ERROR,
1833 (errcode(ERRCODE_INDETERMINATE_COLLATION),
1834 errmsg("could not determine which collation to use for %s function",
1835 "lower()"),
1836 errhint("Use the COLLATE clause to set the collation explicitly.")));
1837 }
1838
1840 ereport(ERROR,
1841 (errcode(ERRCODE_SYNTAX_ERROR),
1842 errmsg("Unicode case folding can only be performed if server encoding is UTF8")));
1843
1845
1846 /* C/POSIX collations use this path regardless of database encoding */
1847 if (mylocale->ctype_is_c)
1848 {
1849 result = asc_tolower(buff, nbytes);
1850 }
1851 else
1852 {
1853 const char *src = buff;
1854 size_t srclen = nbytes;
1855 size_t dstsize;
1856 char *dst;
1857 size_t needed;
1858
1859 /* first try buffer of equal size plus terminating NUL */
1860 dstsize = srclen + 1;
1861 dst = palloc(dstsize);
1862
1863 needed = pg_strfold(dst, dstsize, src, srclen, mylocale);
1864 if (needed + 1 > dstsize)
1865 {
1866 /* grow buffer if needed and retry */
1867 dstsize = needed + 1;
1868 dst = repalloc(dst, dstsize);
1869 needed = pg_strfold(dst, dstsize, src, srclen, mylocale);
1870 Assert(needed + 1 <= dstsize);
1871 }
1872
1873 Assert(dst[needed] == '\0');
1874 result = dst;
1875 }
1876
1877 return result;
1878}
#define OidIsValid(objectId)
Definition: c.h:777
int errhint(const char *fmt,...)
Definition: elog.c:1330
#define ERROR
Definition: elog.h:39
#define ereport(elevel,...)
Definition: elog.h:150
char * asc_tolower(const char *buff, size_t nbytes)
Definition: formatting.c:1887
int GetDatabaseEncoding(void)
Definition: mbutils.c:1262
void * repalloc(void *pointer, Size size)
Definition: mcxt.c:1610
pg_locale_t pg_newlocale_from_collation(Oid collid)
Definition: pg_locale.c:1186
size_t pg_strfold(char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale)
Definition: pg_locale.c:1345
@ PG_UTF8
Definition: pg_wchar.h:232

References asc_tolower(), Assert(), collid, pg_locale_struct::ctype_is_c, ereport, errcode(), errhint(), errmsg(), ERROR, GetDatabaseEncoding(), OidIsValid, palloc(), pg_newlocale_from_collation(), pg_strfold(), PG_UTF8, and repalloc().

Referenced by casefold().

◆ str_initcap()

char * str_initcap ( const char *  buff,
size_t  nbytes,
Oid  collid 
)

Definition at line 1754 of file formatting.c.

1755{
1756 char *result;
1757 pg_locale_t mylocale;
1758
1759 if (!buff)
1760 return NULL;
1761
1762 if (!OidIsValid(collid))
1763 {
1764 /*
1765 * This typically means that the parser could not resolve a conflict
1766 * of implicit collations, so report it that way.
1767 */
1768 ereport(ERROR,
1769 (errcode(ERRCODE_INDETERMINATE_COLLATION),
1770 errmsg("could not determine which collation to use for %s function",
1771 "initcap()"),
1772 errhint("Use the COLLATE clause to set the collation explicitly.")));
1773 }
1774
1776
1777 /* C/POSIX collations use this path regardless of database encoding */
1778 if (mylocale->ctype_is_c)
1779 {
1780 result = asc_initcap(buff, nbytes);
1781 }
1782 else
1783 {
1784 const char *src = buff;
1785 size_t srclen = nbytes;
1786 size_t dstsize;
1787 char *dst;
1788 size_t needed;
1789
1790 /* first try buffer of equal size plus terminating NUL */
1791 dstsize = srclen + 1;
1792 dst = palloc(dstsize);
1793
1794 needed = pg_strtitle(dst, dstsize, src, srclen, mylocale);
1795 if (needed + 1 > dstsize)
1796 {
1797 /* grow buffer if needed and retry */
1798 dstsize = needed + 1;
1799 dst = repalloc(dst, dstsize);
1800 needed = pg_strtitle(dst, dstsize, src, srclen, mylocale);
1801 Assert(needed + 1 <= dstsize);
1802 }
1803
1804 Assert(dst[needed] == '\0');
1805 result = dst;
1806 }
1807
1808 return result;
1809}
char * asc_initcap(const char *buff, size_t nbytes)
Definition: formatting.c:1931
size_t pg_strtitle(char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale)
Definition: pg_locale.c:1325

References asc_initcap(), Assert(), collid, pg_locale_struct::ctype_is_c, ereport, errcode(), errhint(), errmsg(), ERROR, OidIsValid, palloc(), pg_newlocale_from_collation(), pg_strtitle(), and repalloc().

Referenced by initcap(), and str_initcap_z().

◆ str_tolower()

char * str_tolower ( const char *  buff,
size_t  nbytes,
Oid  collid 
)

Definition at line 1626 of file formatting.c.

1627{
1628 char *result;
1629 pg_locale_t mylocale;
1630
1631 if (!buff)
1632 return NULL;
1633
1634 if (!OidIsValid(collid))
1635 {
1636 /*
1637 * This typically means that the parser could not resolve a conflict
1638 * of implicit collations, so report it that way.
1639 */
1640 ereport(ERROR,
1641 (errcode(ERRCODE_INDETERMINATE_COLLATION),
1642 errmsg("could not determine which collation to use for %s function",
1643 "lower()"),
1644 errhint("Use the COLLATE clause to set the collation explicitly.")));
1645 }
1646
1648
1649 /* C/POSIX collations use this path regardless of database encoding */
1650 if (mylocale->ctype_is_c)
1651 {
1652 result = asc_tolower(buff, nbytes);
1653 }
1654 else
1655 {
1656 const char *src = buff;
1657 size_t srclen = nbytes;
1658 size_t dstsize;
1659 char *dst;
1660 size_t needed;
1661
1662 /* first try buffer of equal size plus terminating NUL */
1663 dstsize = srclen + 1;
1664 dst = palloc(dstsize);
1665
1666 needed = pg_strlower(dst, dstsize, src, srclen, mylocale);
1667 if (needed + 1 > dstsize)
1668 {
1669 /* grow buffer if needed and retry */
1670 dstsize = needed + 1;
1671 dst = repalloc(dst, dstsize);
1672 needed = pg_strlower(dst, dstsize, src, srclen, mylocale);
1673 Assert(needed + 1 <= dstsize);
1674 }
1675
1676 Assert(dst[needed] == '\0');
1677 result = dst;
1678 }
1679
1680 return result;
1681}
size_t pg_strlower(char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale)
Definition: pg_locale.c:1315

References asc_tolower(), Assert(), collid, pg_locale_struct::ctype_is_c, ereport, errcode(), errhint(), errmsg(), ERROR, OidIsValid, palloc(), pg_newlocale_from_collation(), pg_strlower(), and repalloc().

Referenced by citext_eq(), citext_hash(), citext_hash_extended(), citext_ne(), citextcmp(), convertPgWchar(), dispell_init(), dispell_lexize(), dsimple_init(), dsimple_lexize(), dsnowball_init(), dsnowball_lexize(), dsynonym_init(), dsynonym_lexize(), dxsyn_lexize(), generate_trgm_only(), generate_wildcard_trgm(), internal_citext_pattern_cmp(), lower(), lowerstr_ctx(), ltree_strncasecmp(), NIImportAffixes(), read_dictionary(), seq_search_localized(), and str_tolower_z().

◆ str_toupper()

char * str_toupper ( const char *  buff,
size_t  nbytes,
Oid  collid 
)

Definition at line 1690 of file formatting.c.

1691{
1692 char *result;
1693 pg_locale_t mylocale;
1694
1695 if (!buff)
1696 return NULL;
1697
1698 if (!OidIsValid(collid))
1699 {
1700 /*
1701 * This typically means that the parser could not resolve a conflict
1702 * of implicit collations, so report it that way.
1703 */
1704 ereport(ERROR,
1705 (errcode(ERRCODE_INDETERMINATE_COLLATION),
1706 errmsg("could not determine which collation to use for %s function",
1707 "upper()"),
1708 errhint("Use the COLLATE clause to set the collation explicitly.")));
1709 }
1710
1712
1713 /* C/POSIX collations use this path regardless of database encoding */
1714 if (mylocale->ctype_is_c)
1715 {
1716 result = asc_toupper(buff, nbytes);
1717 }
1718 else
1719 {
1720 const char *src = buff;
1721 size_t srclen = nbytes;
1722 size_t dstsize;
1723 char *dst;
1724 size_t needed;
1725
1726 /* first try buffer of equal size plus terminating NUL */
1727 dstsize = srclen + 1;
1728 dst = palloc(dstsize);
1729
1730 needed = pg_strupper(dst, dstsize, src, srclen, mylocale);
1731 if (needed + 1 > dstsize)
1732 {
1733 /* grow buffer if needed and retry */
1734 dstsize = needed + 1;
1735 dst = repalloc(dst, dstsize);
1736 needed = pg_strupper(dst, dstsize, src, srclen, mylocale);
1737 Assert(needed + 1 <= dstsize);
1738 }
1739
1740 Assert(dst[needed] == '\0');
1741 result = dst;
1742 }
1743
1744 return result;
1745}
char * asc_toupper(const char *buff, size_t nbytes)
Definition: formatting.c:1909
size_t pg_strupper(char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale)
Definition: pg_locale.c:1335

References asc_toupper(), Assert(), collid, pg_locale_struct::ctype_is_c, ereport, errcode(), errhint(), errmsg(), ERROR, OidIsValid, palloc(), pg_newlocale_from_collation(), pg_strupper(), and repalloc().

Referenced by seq_search_localized(), str_toupper_z(), and upper().