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

1925{
1926 char *result;
1927 int wasalnum = false;
1928
1929 if (!buff)
1930 return NULL;
1931
1932 result = pnstrdup(buff, nbytes);
1933
1934 for (char *p = result; *p; p++)
1935 {
1936 char c;
1937
1938 if (wasalnum)
1939 *p = c = pg_ascii_tolower((unsigned char) *p);
1940 else
1941 *p = c = pg_ascii_toupper((unsigned char) *p);
1942 /* we don't trust isalnum() here */
1943 wasalnum = ((c >= 'A' && c <= 'Z') ||
1944 (c >= 'a' && c <= 'z') ||
1945 (c >= '0' && c <= '9'));
1946 }
1947
1948 return result;
1949}
char * pnstrdup(const char *in, Size len)
Definition: mcxt.c:1792
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 1880 of file formatting.c.

1881{
1882 char *result;
1883
1884 if (!buff)
1885 return NULL;
1886
1887 result = pnstrdup(buff, nbytes);
1888
1889 for (char *p = result; *p; p++)
1890 *p = pg_ascii_tolower((unsigned char) *p);
1891
1892 return result;
1893}

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

1903{
1904 char *result;
1905
1906 if (!buff)
1907 return NULL;
1908
1909 result = pnstrdup(buff, nbytes);
1910
1911 for (char *p = result; *p; p++)
1912 *p = pg_ascii_toupper((unsigned char) *p);
1913
1914 return result;
1915}

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

4318{
4319 bool incache;
4320 size_t fmt_len = strlen(fmt_str);
4321 int result;
4323
4324 if (fmt_len > DCH_CACHE_SIZE)
4325 {
4326 /*
4327 * Allocate new memory if format picture is bigger than static cache
4328 * and do not use cache (call parser always)
4329 */
4330 incache = false;
4331
4332 format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode));
4333
4335 DCH_suff, DCH_index, DCH_FLAG, NULL);
4336 }
4337 else
4338 {
4339 /*
4340 * Use cache buffers
4341 */
4342 DCHCacheEntry *ent = DCH_cache_fetch(fmt_str, false);
4343
4344 incache = true;
4345 format = ent->format;
4346 }
4347
4348 result = DCH_datetime_type(format);
4349
4350 if (!incache)
4351 pfree(format);
4352
4353 return result & DCH_ZONED;
4354}
static const int DCH_index[KeyWord_INDEX_SIZE]
Definition: formatting.c:976
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:1370
#define DCH_FLAG
Definition: formatting.c:90
static const KeySuffix DCH_suff[]
Definition: formatting.c:601
#define DCH_CACHE_SIZE
Definition: formatting.c:374
#define DCH_ZONED
Definition: formatting.c:1055
static int DCH_datetime_type(FormatNode *node)
Definition: formatting.c:3684
static const KeyWord DCH_keywords[]
Definition: formatting.c:805
static DCHCacheEntry * DCH_cache_fetch(const char *str, bool std)
Definition: formatting.c:3861
void pfree(void *pointer)
Definition: mcxt.c:1616
void * palloc(Size size)
Definition: mcxt.c:1387
static char format
FormatNode format[DCH_CACHE_SIZE+1]
Definition: formatting.c:384

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

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

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

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

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

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

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(), 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 1683 of file formatting.c.

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

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