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 1941 of file formatting.c.

1942{
1943 char *result;
1944 int wasalnum = false;
1945
1946 if (!buff)
1947 return NULL;
1948
1949 result = pnstrdup(buff, nbytes);
1950
1951 for (char *p = result; *p; p++)
1952 {
1953 char c;
1954
1955 if (wasalnum)
1956 *p = c = pg_ascii_tolower((unsigned char) *p);
1957 else
1958 *p = c = pg_ascii_toupper((unsigned char) *p);
1959 /* we don't trust isalnum() here */
1960 wasalnum = ((c >= 'A' && c <= 'Z') ||
1961 (c >= 'a' && c <= 'z') ||
1962 (c >= '0' && c <= '9'));
1963 }
1964
1965 return result;
1966}
char * pnstrdup(const char *in, Size len)
Definition: mcxt.c:1770
unsigned char pg_ascii_tolower(unsigned char ch)
Definition: pgstrcasecmp.c:146
unsigned char pg_ascii_toupper(unsigned char ch)
Definition: pgstrcasecmp.c:135
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 1897 of file formatting.c.

1898{
1899 char *result;
1900
1901 if (!buff)
1902 return NULL;
1903
1904 result = pnstrdup(buff, nbytes);
1905
1906 for (char *p = result; *p; p++)
1907 *p = pg_ascii_tolower((unsigned char) *p);
1908
1909 return result;
1910}

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 1919 of file formatting.c.

1920{
1921 char *result;
1922
1923 if (!buff)
1924 return NULL;
1925
1926 result = pnstrdup(buff, nbytes);
1927
1928 for (char *p = result; *p; p++)
1929 *p = pg_ascii_toupper((unsigned char) *p);
1930
1931 return result;
1932}

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 4334 of file formatting.c.

4335{
4336 bool incache;
4337 size_t fmt_len = strlen(fmt_str);
4338 int result;
4340
4341 if (fmt_len > DCH_CACHE_SIZE)
4342 {
4343 /*
4344 * Allocate new memory if format picture is bigger than static cache
4345 * and do not use cache (call parser always)
4346 */
4347 incache = false;
4348
4349 format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode));
4350
4352 DCH_suff, DCH_index, DCH_FLAG, NULL);
4353 }
4354 else
4355 {
4356 /*
4357 * Use cache buffers
4358 */
4359 DCHCacheEntry *ent = DCH_cache_fetch(fmt_str, false);
4360
4361 incache = true;
4362 format = ent->format;
4363 }
4364
4365 result = DCH_datetime_type(format);
4366
4367 if (!incache)
4368 pfree(format);
4369
4370 return result & DCH_ZONED;
4371}
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:3701
static const KeyWord DCH_keywords[]
Definition: formatting.c:813
static DCHCacheEntry * DCH_cache_fetch(const char *str, bool std)
Definition: formatting.c:3878
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 4173 of file formatting.c.

4176{
4177 struct pg_tm tm;
4178 struct fmt_tz ftz;
4179 fsec_t fsec;
4180 int fprec;
4181 uint32 flags;
4182
4183 if (!do_to_timestamp(date_txt, fmt, collid, strict,
4184 &tm, &fsec, &ftz, &fprec, &flags, escontext))
4185 return (Datum) 0;
4186
4187 *typmod = fprec ? fprec : -1; /* fractional part precision */
4188
4189 if (flags & DCH_DATED)
4190 {
4191 if (flags & DCH_TIMED)
4192 {
4193 if (flags & DCH_ZONED)
4194 {
4195 TimestampTz result;
4196
4197 if (ftz.has_tz)
4198 {
4199 *tz = ftz.gmtoffset;
4200 }
4201 else
4202 {
4203 /*
4204 * Time zone is present in format string, but not in input
4205 * string. Assuming do_to_timestamp() triggers no error
4206 * this should be possible only in non-strict case.
4207 */
4208 Assert(!strict);
4209
4210 ereturn(escontext, (Datum) 0,
4211 (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
4212 errmsg("missing time zone in input string for type timestamptz")));
4213 }
4214
4215 if (tm2timestamp(&tm, fsec, tz, &result) != 0)
4216 ereturn(escontext, (Datum) 0,
4217 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4218 errmsg("timestamptz out of range")));
4219
4220 AdjustTimestampForTypmod(&result, *typmod, escontext);
4221
4222 *typid = TIMESTAMPTZOID;
4223 return TimestampTzGetDatum(result);
4224 }
4225 else
4226 {
4227 Timestamp result;
4228
4229 if (tm2timestamp(&tm, fsec, NULL, &result) != 0)
4230 ereturn(escontext, (Datum) 0,
4231 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4232 errmsg("timestamp out of range")));
4233
4234 AdjustTimestampForTypmod(&result, *typmod, escontext);
4235
4236 *typid = TIMESTAMPOID;
4237 return TimestampGetDatum(result);
4238 }
4239 }
4240 else
4241 {
4242 if (flags & DCH_ZONED)
4243 {
4244 ereturn(escontext, (Datum) 0,
4245 (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
4246 errmsg("datetime format is zoned but not timed")));
4247 }
4248 else
4249 {
4250 DateADT result;
4251
4252 /* Prevent overflow in Julian-day routines */
4254 ereturn(escontext, (Datum) 0,
4255 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4256 errmsg("date out of range: \"%s\"", text_to_cstring(date_txt))));
4257
4258 result = date2j(tm.tm_year, tm.tm_mon, tm.tm_mday) -
4260
4261 /* Now check for just-out-of-range dates */
4262 if (!IS_VALID_DATE(result))
4263 ereturn(escontext, (Datum) 0,
4264 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4265 errmsg("date out of range: \"%s\"", text_to_cstring(date_txt))));
4266
4267 *typid = DATEOID;
4268 return DateADTGetDatum(result);
4269 }
4270 }
4271 }
4272 else if (flags & DCH_TIMED)
4273 {
4274 if (flags & DCH_ZONED)
4275 {
4276 TimeTzADT *result = palloc(sizeof(TimeTzADT));
4277
4278 if (ftz.has_tz)
4279 {
4280 *tz = ftz.gmtoffset;
4281 }
4282 else
4283 {
4284 /*
4285 * Time zone is present in format string, but not in input
4286 * string. Assuming do_to_timestamp() triggers no error this
4287 * should be possible only in non-strict case.
4288 */
4289 Assert(!strict);
4290
4291 ereturn(escontext, (Datum) 0,
4292 (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
4293 errmsg("missing time zone in input string for type timetz")));
4294 }
4295
4296 if (tm2timetz(&tm, fsec, *tz, result) != 0)
4297 ereturn(escontext, (Datum) 0,
4298 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4299 errmsg("timetz out of range")));
4300
4301 AdjustTimeForTypmod(&result->time, *typmod);
4302
4303 *typid = TIMETZOID;
4304 return TimeTzADTPGetDatum(result);
4305 }
4306 else
4307 {
4308 TimeADT result;
4309
4310 if (tm2time(&tm, fsec, &result) != 0)
4311 ereturn(escontext, (Datum) 0,
4312 (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
4313 errmsg("time out of range")));
4314
4315 AdjustTimeForTypmod(&result, *typmod);
4316
4317 *typid = TIMEOID;
4318 return TimeADTGetDatum(result);
4319 }
4320 }
4321 else
4322 {
4323 ereturn(escontext, (Datum) 0,
4324 (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
4325 errmsg("datetime format is not dated and not timed")));
4326 }
4327}
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:542
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:1563
int tm2timetz(struct pg_tm *tm, fsec_t fsec, int tz, TimeTzADT *result)
Definition: date.c:2410
void AdjustTimeForTypmod(TimeADT *time, int32 typmod)
Definition: date.c:1792
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:4397
#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 1828 of file formatting.c.

1829{
1830 char *result;
1831 pg_locale_t mylocale;
1832
1833 if (!buff)
1834 return NULL;
1835
1836 if (!OidIsValid(collid))
1837 {
1838 /*
1839 * This typically means that the parser could not resolve a conflict
1840 * of implicit collations, so report it that way.
1841 */
1842 ereport(ERROR,
1843 (errcode(ERRCODE_INDETERMINATE_COLLATION),
1844 errmsg("could not determine which collation to use for %s function",
1845 "lower()"),
1846 errhint("Use the COLLATE clause to set the collation explicitly.")));
1847 }
1848
1850 ereport(ERROR,
1851 (errcode(ERRCODE_SYNTAX_ERROR),
1852 errmsg("Unicode case folding can only be performed if server encoding is UTF8")));
1853
1855
1856 /* C/POSIX collations use this path regardless of database encoding */
1857 if (mylocale->ctype_is_c)
1858 {
1859 result = asc_tolower(buff, nbytes);
1860 }
1861 else
1862 {
1863 const char *src = buff;
1864 size_t srclen = nbytes;
1865 size_t dstsize;
1866 char *dst;
1867 size_t needed;
1868
1869 /* first try buffer of equal size plus terminating NUL */
1870 dstsize = srclen + 1;
1871 dst = palloc(dstsize);
1872
1873 needed = pg_strfold(dst, dstsize, src, srclen, mylocale);
1874 if (needed + 1 > dstsize)
1875 {
1876 /* grow buffer if needed and retry */
1877 dstsize = needed + 1;
1878 dst = repalloc(dst, dstsize);
1879 needed = pg_strfold(dst, dstsize, src, srclen, mylocale);
1880 Assert(needed + 1 <= dstsize);
1881 }
1882
1883 Assert(dst[needed] == '\0');
1884 result = dst;
1885 }
1886
1887 return result;
1888}
#define OidIsValid(objectId)
Definition: c.h:778
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:1897
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:1282
@ 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 1764 of file formatting.c.

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

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 1636 of file formatting.c.

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

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 1700 of file formatting.c.

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

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().