PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/detoast.h"
#include "access/htup_details.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_type.h"
#include "common/hashfn.h"
#include "libpq/pqformat.h"
#include "mb/pg_wchar.h"
#include "nodes/nodeFuncs.h"
#include "nodes/supportnodes.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/pg_locale.h"
#include "utils/varlena.h"
Go to the source code of this file.
Definition at line 34 of file varchar.c.
References ArrayGetIntegerTypmods(), ereport, errcode(), errmsg(), ERROR, MaxAttrSize, and VARHDRSZ.
Referenced by bpchartypmodin(), and varchartypmodin().
|
static |
Definition at line 73 of file varchar.c.
References palloc(), res, snprintf, and VARHDRSZ.
Referenced by bpchartypmodout(), and varchartypmodout().
|
inlinestatic |
Definition at line 671 of file varchar.c.
References arg, bpchartruelen(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by bpchar_larger(), bpchar_smaller(), bpcharcmp(), bpchareq(), bpcharge(), bpchargt(), bpcharle(), bpcharlen(), bpcharlt(), bpcharne(), hashbpchar(), hashbpcharextended(), and internal_bpchar_pattern_compare().
Datum bpchar | ( | PG_FUNCTION_ARGS | ) |
Definition at line 272 of file varchar.c.
References Assert(), ereport, errcode(), errmsg(), ERROR, i, len, palloc(), PG_GETARG_BOOL, PG_GETARG_BPCHAR_PP, PG_GETARG_INT32, pg_mbcharcliplen(), pg_mbstrlen_with_len(), PG_RETURN_BPCHAR_P, SET_VARSIZE, source, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
|
static |
Definition at line 131 of file varchar.c.
References ereturn, errcode(), errmsg(), j, len, palloc(), pg_mbcharcliplen(), pg_mbstrlen_with_len(), SET_VARSIZE, VARDATA, and VARHDRSZ.
Referenced by bpcharin(), and bpcharrecv().
Datum bpchar_larger | ( | PG_FUNCTION_ARGS | ) |
Definition at line 956 of file varchar.c.
References bcTruelen(), cmp(), PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, PG_RETURN_BPCHAR_P, VARDATA_ANY, and varstr_cmp().
Datum bpchar_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 372 of file varchar.c.
References len, NAMEDATALEN, NameStr, palloc0(), PG_GETARG_BPCHAR_PP, pg_mbcliplen(), PG_RETURN_NAME, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum bpchar_pattern_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1170 of file varchar.c.
References internal_bpchar_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_BPCHAR_PP, and PG_RETURN_BOOL.
Datum bpchar_pattern_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1186 of file varchar.c.
References internal_bpchar_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_BPCHAR_PP, and PG_RETURN_BOOL.
Datum bpchar_pattern_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1154 of file varchar.c.
References internal_bpchar_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_BPCHAR_PP, and PG_RETURN_BOOL.
Datum bpchar_pattern_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1138 of file varchar.c.
References internal_bpchar_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_BPCHAR_PP, and PG_RETURN_BOOL.
Datum bpchar_smaller | ( | PG_FUNCTION_ARGS | ) |
Definition at line 974 of file varchar.c.
References bcTruelen(), cmp(), PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, PG_RETURN_BPCHAR_P, VARDATA_ANY, and varstr_cmp().
Datum bpchar_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 939 of file varchar.c.
References collid, MemoryContextSwitchTo(), PG_GETARG_POINTER, PG_RETURN_VOID, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, and varstr_sortsupport().
Datum bpcharcmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 918 of file varchar.c.
References bcTruelen(), cmp(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, PG_RETURN_INT32, VARDATA_ANY, and varstr_cmp().
Referenced by gbt_bpcharcmp().
Datum bpchareq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 744 of file varchar.c.
References bcTruelen(), check_collation_set(), collid, lc_collate_is_c(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, pg_locale_deterministic(), pg_newlocale_from_collation(), PG_RETURN_BOOL, VARDATA_ANY, and varstr_cmp().
Referenced by gbt_bpchareq().
Datum bpcharge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 897 of file varchar.c.
References bcTruelen(), cmp(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, PG_RETURN_BOOL, VARDATA_ANY, and varstr_cmp().
Referenced by gbt_bpcharge().
Datum bpchargt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 876 of file varchar.c.
References bcTruelen(), cmp(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, PG_RETURN_BOOL, VARDATA_ANY, and varstr_cmp().
Referenced by gbt_bpchargt().
Datum bpcharin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 199 of file varchar.c.
References bpchar_input(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_GETARG_OID, and PG_RETURN_BPCHAR_P.
Datum bpcharle | ( | PG_FUNCTION_ARGS | ) |
Definition at line 855 of file varchar.c.
References bcTruelen(), cmp(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, PG_RETURN_BOOL, VARDATA_ANY, and varstr_cmp().
Referenced by gbt_bpcharle().
Datum bpcharlen | ( | PG_FUNCTION_ARGS | ) |
Definition at line 694 of file varchar.c.
References arg, bcTruelen(), len, pg_database_encoding_max_length(), PG_GETARG_BPCHAR_PP, pg_mbstrlen_with_len(), PG_RETURN_INT32, and VARDATA_ANY.
Datum bpcharlt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 834 of file varchar.c.
References bcTruelen(), cmp(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, PG_RETURN_BOOL, VARDATA_ANY, and varstr_cmp().
Referenced by gbt_bpcharlt().
Datum bpcharne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 789 of file varchar.c.
References bcTruelen(), check_collation_set(), collid, lc_collate_is_c(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, pg_locale_deterministic(), pg_newlocale_from_collation(), PG_RETURN_BOOL, VARDATA_ANY, and varstr_cmp().
Datum bpcharoctetlen | ( | PG_FUNCTION_ARGS | ) |
Definition at line 710 of file varchar.c.
References arg, PG_GETARG_DATUM, PG_RETURN_INT32, toast_raw_datum_size(), and VARHDRSZ.
Datum bpcharout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 220 of file varchar.c.
References PG_GETARG_DATUM, PG_RETURN_CSTRING, and TextDatumGetCString.
Datum bpcharrecv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 231 of file varchar.c.
References bpchar_input(), buf, pfree(), PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_BPCHAR_P, pq_getmsgtext(), and generate_unaccent_rules::str.
Datum bpcharsend | ( | PG_FUNCTION_ARGS | ) |
int bpchartruelen | ( | char * | s, |
int | len | ||
) |
Definition at line 677 of file varchar.c.
Referenced by bcTruelen(), bpcharfastcmp_c(), varstr_abbrev_convert(), and varstrfastcmp_locale().
Datum bpchartypmodin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 418 of file varchar.c.
References anychar_typmodin(), PG_GETARG_ARRAYTYPE_P, and PG_RETURN_INT32.
Datum bpchartypmodout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 426 of file varchar.c.
References anychar_typmodout(), PG_GETARG_INT32, and PG_RETURN_CSTRING.
Datum btbpchar_pattern_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1202 of file varchar.c.
References internal_bpchar_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_BPCHAR_PP, and PG_RETURN_INT32.
Datum btbpchar_pattern_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1218 of file varchar.c.
References MemoryContextSwitchTo(), PG_GETARG_POINTER, PG_RETURN_VOID, SortSupportData::ssup_cxt, and varstr_sortsupport().
Datum char_bpchar | ( | PG_FUNCTION_ARGS | ) |
Definition at line 354 of file varchar.c.
References palloc(), PG_GETARG_CHAR, PG_RETURN_BPCHAR_P, SET_VARSIZE, VARDATA, and VARHDRSZ.
|
static |
Definition at line 728 of file varchar.c.
References collid, ereport, errcode(), errhint(), errmsg(), ERROR, and OidIsValid.
Referenced by bpchareq(), and bpcharne().
Datum hashbpchar | ( | PG_FUNCTION_ARGS | ) |
Definition at line 997 of file varchar.c.
References bcTruelen(), buf, collid, elog(), ereport, errcode(), errhint(), errmsg(), ERROR, hash_any(), sort-test::key, lc_collate_is_c(), palloc(), pfree(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, pg_locale_deterministic(), pg_newlocale_from_collation(), pg_strnxfrm(), and VARDATA_ANY.
Datum hashbpcharextended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1052 of file varchar.c.
References bcTruelen(), buf, collid, elog(), ereport, errcode(), errhint(), errmsg(), ERROR, hash_any_extended(), sort-test::key, lc_collate_is_c(), palloc(), pfree(), PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_BPCHAR_PP, PG_GETARG_INT64, pg_locale_deterministic(), pg_newlocale_from_collation(), pg_strnxfrm(), and VARDATA_ANY.
Definition at line 1116 of file varchar.c.
References bcTruelen(), Min, and VARDATA_ANY.
Referenced by bpchar_pattern_ge(), bpchar_pattern_gt(), bpchar_pattern_le(), bpchar_pattern_lt(), and btbpchar_pattern_cmp().
Datum name_bpchar | ( | PG_FUNCTION_ARGS | ) |
Definition at line 408 of file varchar.c.
References cstring_to_text(), NameStr, PG_GETARG_NAME, and PG_RETURN_BPCHAR_P.
Datum varchar | ( | PG_FUNCTION_ARGS | ) |
Definition at line 610 of file varchar.c.
References cstring_to_text_with_len(), ereport, errcode(), errmsg(), ERROR, i, len, PG_GETARG_BOOL, PG_GETARG_INT32, PG_GETARG_VARCHAR_PP, pg_mbcharcliplen(), PG_RETURN_VARCHAR_P, source, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
Referenced by main().
|
static |
Definition at line 458 of file varchar.c.
References cstring_to_text_with_len(), ereturn, errcode(), errmsg(), j, len, pg_mbcharcliplen(), and VARHDRSZ.
Referenced by varcharin(), and varcharrecv().
Datum varchar_support | ( | PG_FUNCTION_ARGS | ) |
Definition at line 566 of file varchar.c.
References FuncExpr::args, Assert(), DatumGetInt32(), exprTypmod(), SupportRequestSimplify::fcall, IsA, linitial, list_length(), lsecond, PG_GETARG_POINTER, PG_RETURN_POINTER, relabel_to_typmod(), source, and VARHDRSZ.
Datum varcharin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 496 of file varchar.c.
References PG_GETARG_CSTRING, PG_GETARG_INT32, PG_GETARG_OID, PG_RETURN_VARCHAR_P, and varchar_input().
Datum varcharout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 517 of file varchar.c.
References PG_GETARG_DATUM, PG_RETURN_CSTRING, and TextDatumGetCString.
Datum varcharrecv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 528 of file varchar.c.
References buf, pfree(), PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_VARCHAR_P, pq_getmsgtext(), generate_unaccent_rules::str, and varchar_input().
Datum varcharsend | ( | PG_FUNCTION_ARGS | ) |
Definition at line 549 of file varchar.c.
References textsend().
Datum varchartypmodin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 649 of file varchar.c.
References anychar_typmodin(), PG_GETARG_ARRAYTYPE_P, and PG_RETURN_INT32.
Datum varchartypmodout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 657 of file varchar.c.
References anychar_typmodout(), PG_GETARG_INT32, and PG_RETURN_CSTRING.