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

1933{
1934 char *result;
1935 int wasalnum = false;
1936
1937 if (!buff)
1938 return NULL;
1939
1940 result = pnstrdup(buff, nbytes);
1941
1942 for (char *p = result; *p; p++)
1943 {
1944 char c;
1945
1946 if (wasalnum)
1947 *p = c = pg_ascii_tolower((unsigned char) *p);
1948 else
1949 *p = c = pg_ascii_toupper((unsigned char) *p);
1950 /* we don't trust isalnum() here */
1951 wasalnum = ((c >= 'A' && c <= 'Z') ||
1952 (c >= 'a' && c <= 'z') ||
1953 (c >= '0' && c <= '9'));
1954 }
1955
1956 return result;
1957}
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 1888 of file formatting.c.

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

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

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

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

4326{
4327 bool incache;
4328 size_t fmt_len = strlen(fmt_str);
4329 int result;
4331
4332 if (fmt_len > DCH_CACHE_SIZE)
4333 {
4334 /*
4335 * Allocate new memory if format picture is bigger than static cache
4336 * and do not use cache (call parser always)
4337 */
4338 incache = false;
4339
4340 format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode));
4341
4343 DCH_suff, DCH_index, DCH_FLAG, NULL);
4344 }
4345 else
4346 {
4347 /*
4348 * Use cache buffers
4349 */
4350 DCHCacheEntry *ent = DCH_cache_fetch(fmt_str, false);
4351
4352 incache = true;
4353 format = ent->format;
4354 }
4355
4356 result = DCH_datetime_type(format);
4357
4358 if (!incache)
4359 pfree(format);
4360
4361 return result & DCH_ZONED;
4362}
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:1378
#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:1063
static int DCH_datetime_type(FormatNode *node)
Definition: formatting.c:3692
static const KeyWord DCH_keywords[]
Definition: formatting.c:813
static DCHCacheEntry * DCH_cache_fetch(const char *str, bool std)
Definition: formatting.c:3869
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 4164 of file formatting.c.

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

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

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

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

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