28 const char *set,
int setlen,
206 errmsg(
"requested length too large")));
304 errmsg(
"requested length too large")));
395 const char *set,
int setlen,
855 errmsg(
"requested length too large")));
962 result = *
data & 0x07;
965 else if (*
data >= 0xE0)
967 result = *
data & 0x0F;
973 result = *
data & 0x1f;
982 result = (result << 6) + (
data[
i] & 0x3f);
992 errmsg(
"requested character too large")));
1036 errmsg(
"character number must be positive")));
1040 errmsg(
"null character not permitted")));
1058 errmsg(
"requested character too large for encoding: %u",
1063 else if (
cvalue > 0x07ff)
1077 else if (bytes == 3)
1079 wch[0] = 0xE0 | ((
cvalue >> 12) & 0x0F);
1085 wch[0] = 0xF0 | ((
cvalue >> 18) & 0x07);
1086 wch[1] = 0x80 | ((
cvalue >> 12) & 0x3F);
1099 errmsg(
"requested character not valid for encoding: %u",
1111 errmsg(
"requested character too large for encoding: %u",
1158 errmsg(
"requested length too large")));
1165 for (
i = 0;
i < count;
i++)
#define Assert(condition)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_BYTEA_PP(n)
#define PG_GETARG_TEXT_PP(n)
#define PG_RETURN_BYTEA_P(x)
#define PG_RETURN_TEXT_P(x)
#define PG_RETURN_INT32(x)
#define PG_GETARG_INT32(n)
#define PG_GET_COLLATION()
static bool pg_mul_s32_overflow(int32 a, int32 b, int32 *result)
static bool pg_add_s32_overflow(int32 a, int32 b, int32 *result)
int GetDatabaseEncoding(void)
int pg_mbstrlen_with_len(const char *mbstr, int limit)
int pg_database_encoding_max_length(void)
int pg_mblen(const char *mbstr)
void pfree(void *pointer)
#define AllocSizeIsValid(size)
#define CHECK_FOR_INTERRUPTS()
static text * dotrim(const char *string, int stringlen, const char *set, int setlen, bool doltrim, bool dortrim)
Datum bytealtrim(PG_FUNCTION_ARGS)
Datum ltrim(PG_FUNCTION_ARGS)
Datum byteatrim(PG_FUNCTION_ARGS)
Datum lower(PG_FUNCTION_ARGS)
Datum initcap(PG_FUNCTION_ARGS)
Datum upper(PG_FUNCTION_ARGS)
Datum byteartrim(PG_FUNCTION_ARGS)
Datum rtrim(PG_FUNCTION_ARGS)
Datum rpad(PG_FUNCTION_ARGS)
Datum ltrim1(PG_FUNCTION_ARGS)
Datum btrim1(PG_FUNCTION_ARGS)
Datum ascii(PG_FUNCTION_ARGS)
Datum rtrim1(PG_FUNCTION_ARGS)
Datum casefold(PG_FUNCTION_ARGS)
Datum translate(PG_FUNCTION_ARGS)
static bytea * dobyteatrim(bytea *string, bytea *set, bool doltrim, bool dortrim)
Datum lpad(PG_FUNCTION_ARGS)
Datum btrim(PG_FUNCTION_ARGS)
Datum repeat(PG_FUNCTION_ARGS)
static rewind_source * source
static Size VARSIZE_ANY_EXHDR(const void *PTR)
static char * VARDATA(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
static void SET_VARSIZE(void *PTR, Size len)
text * cstring_to_text_with_len(const char *s, int len)
text * cstring_to_text(const char *s)
bool pg_utf8_islegal(const unsigned char *source, int length)
int pg_encoding_max_length(int encoding)