PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include <limits.h>
#include "access/detoast.h"
#include "access/toast_compression.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_type.h"
#include "common/hashfn.h"
#include "common/int.h"
#include "common/unicode_category.h"
#include "common/unicode_norm.h"
#include "common/unicode_version.h"
#include "funcapi.h"
#include "lib/hyperloglog.h"
#include "libpq/pqformat.h"
#include "miscadmin.h"
#include "nodes/execnodes.h"
#include "parser/scansup.h"
#include "port/pg_bswap.h"
#include "regex/regex.h"
#include "utils/builtins.h"
#include "utils/bytea.h"
#include "utils/guc.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/pg_locale.h"
#include "utils/sortsupport.h"
#include "utils/varlena.h"
#include "levenshtein.c"
Go to the source code of this file.
Data Structures | |
struct | TextPositionState |
struct | VarStringSortSupport |
struct | SplitTextOutputData |
Macros | |
#define | TEXTBUFLEN 1024 |
#define | DatumGetVarStringP(X) ((VarString *) PG_DETOAST_DATUM(X)) |
#define | DatumGetVarStringPP(X) ((VarString *) PG_DETOAST_DATUM_PACKED(X)) |
#define | VAL(CH) ((CH) - '0') |
#define | DIG(VAL) ((VAL) + '0') |
#define | CmpCall(cmpfunc) |
#define | PG_STR_GET_BYTEA(str_) DatumGetByteaPP(DirectFunctionCall1(byteain, CStringGetDatum(str_))) |
#define | TEXT_FORMAT_FLAG_MINUS 0x0001 /* is minus flag present? */ |
#define | ADVANCE_PARSE_POINTER(ptr, end_ptr) |
#define | LEVENSHTEIN_LESS_EQUAL |
Typedefs | |
typedef struct varlena | VarString |
Variables | |
int | bytea_output = BYTEA_OUTPUT_HEX |
#define ADVANCE_PARSE_POINTER | ( | ptr, | |
end_ptr | |||
) |
#define CmpCall | ( | cmpfunc | ) |
#define DatumGetVarStringP | ( | X | ) | ((VarString *) PG_DETOAST_DATUM(X)) |
#define DatumGetVarStringPP | ( | X | ) | ((VarString *) PG_DETOAST_DATUM_PACKED(X)) |
#define PG_STR_GET_BYTEA | ( | str_ | ) | DatumGetByteaPP(DirectFunctionCall1(byteain, CStringGetDatum(str_))) |
#define TEXT_FORMAT_FLAG_MINUS 0x0001 /* is minus flag present? */ |
|
static |
Definition at line 4081 of file varlena.c.
References appendBinaryStringInfo(), appendStringInfoChar(), Assert, charlen_to_bytelen(), idx(), replace_text(), str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by replace_text_regexp().
|
static |
Definition at line 3957 of file varlena.c.
References appendBinaryStringInfo(), str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by replace_text(), replace_text_regexp(), string_agg_transfn(), xmlcomment(), and XmlTableGetValue().
Datum array_to_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4741 of file varlena.c.
References array_to_text_internal(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, and text_to_cstring().
|
static |
Definition at line 4783 of file varlena.c.
References appendStringInfo(), appendStringInfoString(), ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_NDIM, ARR_NULLBITMAP, ArrayGetNItems(), att_addlength_pointer, att_align_nominal, buf, cstring_to_text_with_len(), ArrayMetaState::element_type, fetch_att(), FunctionCallInfoBaseData::flinfo, fmgr_info_cxt(), FmgrInfo::fn_extra, FmgrInfo::fn_mcxt, get_type_io_data(), i, if(), initStringInfo(), IOFunc_output, MemoryContextAlloc(), nitems, OutputFunctionCall(), pfree(), ArrayMetaState::proc, typalign, ArrayMetaState::typalign, ArrayMetaState::typbyval, ArrayMetaState::typdelim, ArrayMetaState::typiofunc, ArrayMetaState::typioparam, ArrayMetaState::typlen, and value.
Referenced by array_to_text(), array_to_text_null(), and concat_internal().
Datum array_to_text_null | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4757 of file varlena.c.
References array_to_text_internal(), PG_ARGISNULL, PG_GETARG_ARRAYTYPE_P, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, and text_to_cstring().
|
static |
Definition at line 2030 of file varlena.c.
References bpchartruelen(), DatumGetBpCharPP, Min, pfree(), PointerGetDatum(), VARDATA_ANY, VARSIZE_ANY_EXHDR, x, and y.
Referenced by varstr_sortsupport().
Datum btnametextcmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2675 of file varlena.c.
References NameStr, PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_INT32, VARDATA_ANY, VARSIZE_ANY_EXHDR, and varstr_cmp().
Referenced by namegetext(), namegttext(), nameletext(), and namelttext().
Datum bttext_pattern_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2858 of file varlena.c.
References internal_text_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_TEXT_PP, and PG_RETURN_INT32.
Datum bttext_pattern_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2874 of file varlena.c.
References MemoryContextSwitchTo(), PG_GETARG_POINTER, PG_RETURN_VOID, SortSupportData::ssup_cxt, and varstr_sortsupport().
Datum bttextcmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1814 of file varlena.c.
References PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_INT32, and text_cmp().
Referenced by gbt_textcmp().
Datum bttextnamecmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2691 of file varlena.c.
References NameStr, PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_INT32, VARDATA_ANY, VARSIZE_ANY_EXHDR, and varstr_cmp().
Referenced by textgename(), textgtname(), textlename(), and textltname().
Datum bttextsortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1829 of file varlena.c.
References collid, MemoryContextSwitchTo(), PG_GETARG_POINTER, PG_RETURN_VOID, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, and varstr_sortsupport().
Datum btvarstrequalimage | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2532 of file varlena.c.
References check_collation_set(), collid, locale, PG_GET_COLLATION, pg_newlocale_from_collation(), and PG_RETURN_BOOL.
|
static |
Definition at line 5359 of file varlena.c.
References elog, ERROR, FunctionCallInfoBaseData::flinfo, fmgr_info_cxt(), FmgrInfo::fn_extra, FmgrInfo::fn_mcxt, get_fn_expr_argtype(), getTypeOutputInfo(), i, MemoryContextAlloc(), OidIsValid, and PG_NARGS.
Referenced by concat_internal().
Datum bytea_bit_count | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3126 of file varlena.c.
References PG_GETARG_BYTEA_PP, pg_popcount(), PG_RETURN_INT64, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Definition at line 2928 of file varlena.c.
References len, palloc(), SET_VARSIZE, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
Referenced by bytea_overlay(), and byteacat().
Definition at line 3093 of file varlena.c.
References bytea_catenate(), bytea_substring(), ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PointerGetDatum(), s1, and s2.
Referenced by byteaoverlay(), and byteaoverlay_no_len().
Datum bytea_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3935 of file varlena.c.
References MemoryContextSwitchTo(), PG_GETARG_POINTER, PG_RETURN_VOID, SortSupportData::ssup_cxt, and varstr_sortsupport().
Datum bytea_string_agg_finalfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 551 of file varlena.c.
References AggCheckCallContext(), Assert, palloc(), PG_ARGISNULL, PG_GETARG_POINTER, PG_RETURN_BYTEA_P, PG_RETURN_NULL, SET_VARSIZE, VARDATA, and VARHDRSZ.
Datum bytea_string_agg_transfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 498 of file varlena.c.
References appendBinaryStringInfo(), makeStringAggState(), PG_ARGISNULL, PG_GETARG_BYTEA_PP, PG_GETARG_POINTER, PG_RETURN_NULL, PG_RETURN_POINTER, value, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum bytea_substr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2980 of file varlena.c.
References bytea_substring(), PG_GETARG_DATUM, PG_GETARG_INT32, and PG_RETURN_BYTEA_P.
Datum bytea_substr_no_len | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2994 of file varlena.c.
References bytea_substring(), PG_GETARG_DATUM, PG_GETARG_INT32, and PG_RETURN_BYTEA_P.
Definition at line 3003 of file varlena.c.
References DatumGetByteaPSlice, ereport, errcode(), errmsg(), ERROR, Max, pg_add_s32_overflow(), PG_STR_GET_BYTEA, S, and str.
Referenced by bytea_overlay(), bytea_substr(), and bytea_substr_no_len().
Datum byteacat | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2913 of file varlena.c.
References bytea_catenate(), PG_GETARG_BYTEA_PP, and PG_RETURN_BYTEA_P.
Datum byteacmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3913 of file varlena.c.
References cmp(), Min, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_RETURN_INT32, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by gbt_bitcmp(), and gbt_byteacmp().
Datum byteaeq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3769 of file varlena.c.
References DatumGetByteaPP, PG_FREE_IF_COPY, PG_GETARG_DATUM, PG_RETURN_BOOL, toast_raw_datum_size(), VARDATA_ANY, and VARHDRSZ.
Referenced by gbt_byteaeq().
Datum byteage | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3893 of file varlena.c.
References cmp(), Min, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_RETURN_BOOL, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by gbt_byteage().
Datum byteaGetBit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3213 of file varlena.c.
References ereport, errcode(), errmsg(), ERROR, len, PG_GETARG_BYTEA_PP, PG_GETARG_INT64, PG_RETURN_INT32, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum byteaGetByte | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3184 of file varlena.c.
References ereport, errcode(), errmsg(), ERROR, len, PG_GETARG_BYTEA_PP, PG_GETARG_INT32, PG_RETURN_INT32, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum byteagt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3873 of file varlena.c.
References cmp(), Min, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_RETURN_BOOL, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by gbt_byteagt().
Datum byteain | ( | PG_FUNCTION_ARGS | ) |
Definition at line 290 of file varlena.c.
References ereturn, errcode(), errmsg(), hex_decode_safe(), len, palloc(), PG_GETARG_CSTRING, PG_RETURN_BYTEA_P, SET_VARSIZE, VAL, VARDATA, and VARHDRSZ.
Referenced by CreateTriggerFiringOn(), and string_to_datum().
Datum byteale | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3853 of file varlena.c.
References cmp(), Min, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_RETURN_BOOL, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by gbt_byteale().
Datum bytealt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3833 of file varlena.c.
References cmp(), Min, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_RETURN_BOOL, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by gbt_bytealt().
Datum byteane | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3801 of file varlena.c.
References DatumGetByteaPP, PG_FREE_IF_COPY, PG_GETARG_DATUM, PG_RETURN_BOOL, toast_raw_datum_size(), VARDATA_ANY, and VARHDRSZ.
Datum byteaoctetlen | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2897 of file varlena.c.
References PG_GETARG_DATUM, PG_RETURN_INT32, str, toast_raw_datum_size(), and VARHDRSZ.
Datum byteaout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 388 of file varlena.c.
References bytea_output, BYTEA_OUTPUT_ESCAPE, BYTEA_OUTPUT_HEX, DIG, elog, ereport, errcode(), errmsg_internal(), ERROR, hex_encode(), i, len, MaxAllocSize, palloc(), PG_GETARG_BYTEA_PP, PG_RETURN_CSTRING, val, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by pg_mcv_list_out().
Datum byteaoverlay | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3070 of file varlena.c.
References bytea_overlay(), PG_GETARG_BYTEA_PP, PG_GETARG_INT32, and PG_RETURN_BYTEA_P.
Datum byteaoverlay_no_len | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3081 of file varlena.c.
References bytea_overlay(), PG_GETARG_BYTEA_PP, PG_GETARG_INT32, PG_RETURN_BYTEA_P, and VARSIZE_ANY_EXHDR.
Datum byteapos | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3140 of file varlena.c.
References p2, PG_GETARG_BYTEA_PP, PG_RETURN_INT32, px(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum bytearecv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 471 of file varlena.c.
References buf, palloc(), PG_GETARG_POINTER, PG_RETURN_BYTEA_P, pq_copymsgbytes(), SET_VARSIZE, VARDATA, and VARHDRSZ.
Datum byteasend | ( | PG_FUNCTION_ARGS | ) |
Definition at line 490 of file varlena.c.
References PG_GETARG_BYTEA_P_COPY, and PG_RETURN_BYTEA_P.
Referenced by brin_bloom_summary_send(), brin_minmax_multi_summary_send(), pg_dependencies_send(), pg_mcv_list_send(), and pg_ndistinct_send().
Datum byteaSetBit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3283 of file varlena.c.
References ereport, errcode(), errmsg(), ERROR, len, PG_GETARG_BYTEA_P_COPY, PG_GETARG_INT32, PG_GETARG_INT64, PG_RETURN_BYTEA_P, res, VARDATA, VARHDRSZ, and VARSIZE.
Datum byteaSetByte | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3251 of file varlena.c.
References ereport, errcode(), errmsg(), ERROR, len, PG_GETARG_BYTEA_P_COPY, PG_GETARG_INT32, PG_RETURN_BYTEA_P, res, VARDATA, VARHDRSZ, and VARSIZE.
|
static |
Definition at line 806 of file varlena.c.
References pg_database_encoding_max_length(), and pg_mblen().
Referenced by appendStringInfoRegexpSubstr(), and replace_text_regexp().
|
static |
Definition at line 1509 of file varlena.c.
References collid, ereport, errcode(), errhint(), errmsg(), ERROR, and OidIsValid.
Referenced by btvarstrequalimage(), nameeqtext(), namenetext(), text_position_setup(), text_starts_with(), texteq(), texteqname(), textne(), textnename(), varstr_cmp(), and varstr_sortsupport().
|
static |
Definition at line 4048 of file varlena.c.
References replace_text(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by replace_text_regexp().
|
static |
Definition at line 5397 of file varlena.c.
References appendStringInfoString(), array_to_text_internal(), Assert, build_concat_foutcache(), cstring_to_text_with_len(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_extra, get_base_element_type(), get_fn_expr_argtype(), get_fn_expr_variadic(), i, if(), initStringInfo(), OidIsValid, OutputFunctionCall(), pfree(), PG_ARGISNULL, PG_GETARG_ARRAYTYPE_P, PG_GETARG_DATUM, PG_NARGS, str, and value.
Referenced by text_concat(), and text_concat_ws().
|
inlinestatic |
Definition at line 4905 of file varlena.c.
References Assert, BITS_PER_BYTE, buf, cstring_to_text_with_len(), digits, and value.
Referenced by to_bin32(), to_bin64(), to_hex32(), to_hex64(), to_oct32(), and to_oct64().
text* cstring_to_text | ( | const char * | s | ) |
Definition at line 184 of file varlena.c.
References cstring_to_text_with_len().
Referenced by array_dims(), ASN1_STRING_to_text(), booltext(), brin_minmax_multi_summary_out(), brin_page_type(), build_test_info_result(), build_test_match_result(), cidr_abbrev(), convert_charset(), cstring_to_xmltype(), current_query(), datetime_to_char_body(), dblink_build_sql_delete(), dblink_build_sql_insert(), dblink_build_sql_update(), dblink_cancel_query(), dblink_close(), dblink_connect(), dblink_disconnect(), dblink_error_message(), dblink_exec(), dblink_open(), dmetaphone(), dmetaphone_alt(), exec_assign_c_string(), executeDateTimeMethod(), filter_list_to_array(), format_type(), get_command_tag(), get_command_type(), get_scalar(), hash_page_type(), icu_unicode_version(), inet_abbrev(), initcap(), json_in(), json_typeof(), jsonb_get_element(), jsonb_typeof(), JsonbValueAsText(), lower(), md5_bytea(), md5_text(), metaphone(), name_bpchar(), name_text(), network_host(), network_show(), oidvectortypes(), ParameterAclCreate(), ParameterAclLookup(), pg_collation_actual_version(), pg_collation_for(), pg_column_compression(), pg_crypt(), pg_current_logfile(), pg_database_collation_actual_version(), pg_describe_object(), pg_export_snapshot(), pg_get_statisticsobjdef_expressions(), pg_get_wal_replay_pause_state(), pg_parameter_aclmask(), pg_relation_filepath(), pg_size_pretty(), pg_size_pretty_numeric(), pg_stat_get_backend_activity(), pg_stat_get_backend_wait_event(), pg_stat_get_backend_wait_event_type(), pg_stat_get_slru(), pg_stats_ext_mcvlist_items(), pg_tablespace_location(), pg_walfile_name(), pg_xact_status(), pgsql_version(), pgxml_result_to_text(), quote_ident(), quote_ident_cstr(), quote_nullable(), sepgsql_getcon(), sepgsql_mcstrans_in(), sepgsql_mcstrans_out(), set_config_by_name(), show_all_file_settings(), show_config_by_name(), show_config_by_name_missing_ok(), ShowAllGUCConfig(), soundex(), split_part(), ssl_cipher(), ssl_client_dn(), ssl_issuer_dn(), ssl_version(), string_to_text(), test_canonicalize_path(), test_slru_page_read(), test_slru_page_readonly(), text_substring(), textin(), timeofday(), timetz_at_local(), tsquerytree(), unaccent_dict(), unicode_version(), upper(), xml_encode_special_chars(), xml_in(), and xml_recv().
text* cstring_to_text_with_len | ( | const char * | s, |
int | len | ||
) |
Definition at line 196 of file varlena.c.
References len, palloc(), SET_VARSIZE, VARDATA, and VARHDRSZ.
Referenced by array_to_json(), array_to_json_pretty(), array_to_text_internal(), brin_minmax_multi_summary_out(), build_regexp_match_result(), build_regexp_split_result(), build_test_match_result(), cash_words(), compute_tsvector_stats(), concat_internal(), convert_to_base(), cstring_to_text(), daitch_mokotoff_coding(), datum_to_json(), do_text_output_multiline(), dotrim(), each_object_field_end(), each_worker_jsonb(), elements_array_element_end(), ExecEvalMergeSupportFunc(), ExecEvalXmlExpr(), executeDateTimeMethod(), executeLikeRegex(), find_or_create_child_node(), fsm_page_contents(), get_array_element_end(), get_array_end(), get_object_end(), get_object_field_end(), get_scalar(), gin_extract_tsquery(), gin_extract_tsvector(), hstore_akeys(), hstore_avals(), hstore_each(), hstore_fetchval(), hstore_skeys(), hstore_slice_to_array(), hstore_subscript_fetch(), hstore_svals(), hstore_to_array_internal(), hstore_to_json(), hstore_to_json_loose(), json_build_array_noargs(), json_build_array_worker(), json_build_object_noargs(), json_build_object_worker(), json_object(), json_object_two_arg(), json_recv(), json_strip_nulls(), jsonb_pretty(), JsonbValueAsText(), leftmostvalue_text(), LogicalOutputWrite(), parse_ident(), pg_gen_salt(), pg_gen_salt_rounds(), pg_get_function_sqlbody(), replace_text(), replace_text_regexp(), row_to_json(), row_to_json_pretty(), serialize_deflist(), split_part(), split_text(), ssl_extension_info(), string_agg_finalfn(), stringinfo_to_xmltype(), text_format(), text_left(), text_right(), textrecv(), transform_json_string_values(), tsquerytree(), tsvector_to_array(), tsvector_unnest(), unistr(), varchar(), varchar_input(), xmltext(), xmltotext_with_options(), and xslt_process().
const char* getClosestMatch | ( | ClosestMatchState * | state | ) |
Definition at line 6218 of file varlena.c.
References Assert.
Referenced by dblink_fdw_validator(), file_fdw_validator(), postgres_fdw_validator(), and postgresql_fdw_validator().
|
static |
|
static |
Datum icu_unicode_version | ( | PG_FUNCTION_ARGS | ) |
Definition at line 6277 of file varlena.c.
References cstring_to_text(), PG_RETURN_NULL, and PG_RETURN_TEXT_P.
Referenced by main().
void initClosestMatch | ( | ClosestMatchState * | state, |
const char * | source, | ||
int | max_d | ||
) |
Definition at line 6163 of file varlena.c.
References Assert, and source.
Referenced by dblink_fdw_validator(), file_fdw_validator(), postgres_fdw_validator(), and postgresql_fdw_validator().
Definition at line 2772 of file varlena.c.
References Min, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by bttext_pattern_cmp(), text_pattern_ge(), text_pattern_gt(), text_pattern_le(), and text_pattern_lt().
|
static |
|
static |
Definition at line 5137 of file varlena.c.
References AggCheckCallContext(), elog, ERROR, makeStringInfo(), and MemoryContextSwitchTo().
Referenced by bytea_string_agg_transfn(), string_agg_combine(), string_agg_deserialize(), and string_agg_transfn().
Datum name_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3357 of file varlena.c.
References cstring_to_text(), NameStr, PG_GETARG_NAME, and PG_RETURN_TEXT_P.
Referenced by nameiclike(), and nameicnlike().
Datum nameeqtext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2575 of file varlena.c.
References check_collation_set(), collid, NameStr, PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, VARDATA_ANY, VARSIZE_ANY_EXHDR, and varstr_cmp().
|
static |
Definition at line 2063 of file varlena.c.
References DatumGetName(), NAMEDATALEN, NameStr, x, and y.
Referenced by varstr_sortsupport().
|
static |
Definition at line 2106 of file varlena.c.
References DatumGetName(), NameStr, varstrfastcmp_locale(), x, and y.
Referenced by varstr_sortsupport().
Datum namegetext | ( | PG_FUNCTION_ARGS | ) |
Datum namegttext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2725 of file varlena.c.
References btnametextcmp(), CmpCall, and PG_RETURN_BOOL.
Datum nameletext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2719 of file varlena.c.
References btnametextcmp(), CmpCall, and PG_RETURN_BOOL.
Datum namelttext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2713 of file varlena.c.
References btnametextcmp(), CmpCall, and PG_RETURN_BOOL.
Datum namenetext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2625 of file varlena.c.
References check_collation_set(), collid, NameStr, PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, VARDATA_ANY, VARSIZE_ANY_EXHDR, and varstr_cmp().
Datum pg_column_compression | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5036 of file varlena.c.
References cstring_to_text(), DatumGetPointer(), elog, ERROR, get_fn_expr_argtype(), get_typlen(), MemoryContextAlloc(), PG_GETARG_DATUM, PG_RETURN_NULL, PG_RETURN_TEXT_P, toast_get_compression_id(), TOAST_INVALID_COMPRESSION_ID, TOAST_LZ4_COMPRESSION_ID, and TOAST_PGLZ_COMPRESSION_ID.
Datum pg_column_size | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4989 of file varlena.c.
References DatumGetCString(), elog, ERROR, get_fn_expr_argtype(), get_typlen(), MemoryContextAlloc(), PG_GETARG_DATUM, PG_RETURN_INT32, toast_datum_size(), and value.
Datum pg_column_toast_chunk_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5089 of file varlena.c.
References DatumGetPointer(), elog, ERROR, get_fn_expr_argtype(), get_typlen(), MemoryContextAlloc(), PG_GETARG_DATUM, PG_RETURN_NULL, PG_RETURN_OID, varatt_external::va_valueid, VARATT_EXTERNAL_GET_POINTER, and VARATT_IS_EXTERNAL_ONDISK.
Datum replace_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3971 of file varlena.c.
References appendBinaryStringInfo(), appendStringInfoText(), CHECK_FOR_INTERRUPTS, cstring_to_text_with_len(), initStringInfo(), pfree(), PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, str, text_position_cleanup(), text_position_get_match_ptr(), text_position_next(), text_position_setup(), VARDATA_ANY, VARSIZE_ANY, and VARSIZE_ANY_EXHDR.
Referenced by appendStringInfoRegexpSubstr(), check_replace_text_has_escape(), execute_extension_script(), and replace_text_regexp().
text* replace_text_regexp | ( | text * | src_text, |
text * | pattern_text, | ||
text * | replace_text, | ||
int | cflags, | ||
Oid | collation, | ||
int | search_start, | ||
int | n | ||
) |
Definition at line 4181 of file varlena.c.
References appendBinaryStringInfo(), appendStringInfoRegexpSubstr(), appendStringInfoText(), buf, charlen_to_bytelen(), CHECK_FOR_INTERRUPTS, check_replace_text_has_escape(), cstring_to_text_with_len(), data, ereport, errcode(), errmsg(), ERROR, initStringInfo(), lengthof, palloc(), pfree(), pg_mb2wchar_with_len(), pg_regerror(), pg_regexec(), RE_compile_and_cache(), REG_NOMATCH, REG_NOSUB, REG_OKAY, regex_t, regmatch_t, replace_text(), VARDATA_ANY, VARSIZE_ANY, and VARSIZE_ANY_EXHDR.
Referenced by textregexreplace(), textregexreplace_extended(), and textregexreplace_noopt().
|
inlinestatic |
Datum split_part | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4343 of file varlena.c.
References Assert, cstring_to_text(), cstring_to_text_with_len(), ereport, errcode(), errmsg(), ERROR, PG_GET_COLLATION, PG_GETARG_INT32, PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, text_position_cleanup(), text_position_get_match_ptr(), text_position_next(), text_position_reset(), text_position_setup(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
|
static |
Definition at line 4566 of file varlena.c.
References CHECK_FOR_INTERRUPTS, cstring_to_text_with_len(), pfree(), PG_ARGISNULL, PG_GET_COLLATION, PG_GETARG_TEXT_PP, pg_mblen(), PG_NARGS, split_text_accum_result(), text_position_cleanup(), text_position_get_match_ptr(), text_position_next(), text_position_setup(), VARDATA_ANY, VARSIZE_ANY, and VARSIZE_ANY_EXHDR.
Referenced by text_to_array(), and text_to_table().
|
static |
Definition at line 4702 of file varlena.c.
References accumArrayResult(), SplitTextOutputData::astate, CurrentMemoryContext, PointerGetDatum(), text_isequal(), SplitTextOutputData::tupdesc, tuplestore_putvalues(), SplitTextOutputData::tupstore, and values.
Referenced by split_text().
Definition at line 3559 of file varlena.c.
References canonicalize_path(), lappend(), MAXPGPATH, NIL, pstrdup(), and scanner_isspace().
Referenced by load_libraries(), and PostmasterMain().
Definition at line 3680 of file varlena.c.
References lappend(), NIL, and scanner_isspace().
Referenced by check_debug_io_direct(), dumpFunc(), parse_hba_auth_opt(), pg_get_functiondef(), and PostmasterMain().
Definition at line 3432 of file varlena.c.
References Assert, downcase_truncate_identifier(), lappend(), len, NIL, pfree(), scanner_isspace(), and truncate_identifier().
Referenced by check_createrole_self_grant(), check_datestyle(), check_log_destination(), check_restrict_nonsystem_relation_kind(), check_search_path(), check_temp_tablespaces(), check_wal_consistency_checking(), ExtractExtensionList(), parse_extension_control_file(), parse_output_parameters(), parse_publication_options(), plpgsql_extra_checks_check_hook(), PrepareTempTablespaces(), preprocessNamespacePath(), stringToQualifiedNameList(), textToQualifiedNameList(), and validate_sync_standby_slots().
Datum string_agg_combine | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5216 of file varlena.c.
References AggCheckCallContext(), appendBinaryStringInfo(), StringInfoData::cursor, StringInfoData::data, elog, ERROR, StringInfoData::len, makeStringAggState(), MemoryContextSwitchTo(), PG_ARGISNULL, PG_GETARG_POINTER, PG_RETURN_NULL, and PG_RETURN_POINTER.
Datum string_agg_deserialize | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5297 of file varlena.c.
References AggCheckCallContext(), appendBinaryStringInfo(), Assert, buf, StringInfoData::cursor, data, initReadOnlyStringInfo(), makeStringAggState(), PG_GETARG_BYTEA_PP, PG_RETURN_POINTER, pq_getmsgbytes(), pq_getmsgend(), pq_getmsgint(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum string_agg_finalfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5333 of file varlena.c.
References AggCheckCallContext(), Assert, cstring_to_text_with_len(), PG_ARGISNULL, PG_GETARG_POINTER, PG_RETURN_NULL, and PG_RETURN_TEXT_P.
Datum string_agg_serialize | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5266 of file varlena.c.
References AggCheckCallContext(), Assert, buf, PG_GETARG_POINTER, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendbytes(), and pq_sendint().
Datum string_agg_transfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5161 of file varlena.c.
References appendStringInfoText(), makeStringAggState(), PG_ARGISNULL, PG_GETARG_POINTER, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_POINTER, value, and VARSIZE_ANY_EXHDR.
Definition at line 765 of file varlena.c.
References len, palloc(), SET_VARSIZE, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
Referenced by text_overlay(), and textcat().
Definition at line 1586 of file varlena.c.
References collid, VARDATA_ANY, VARSIZE_ANY_EXHDR, and varstr_cmp().
Referenced by bttextcmp(), text_ge(), text_gt(), text_larger(), text_le(), text_lt(), text_smaller(), texteq(), and textne().
Datum text_concat | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5477 of file varlena.c.
References concat_internal(), PG_RETURN_NULL, and PG_RETURN_TEXT_P.
Datum text_concat_ws | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5492 of file varlena.c.
References concat_internal(), PG_ARGISNULL, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, and text_to_cstring().
Datum text_format | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5613 of file varlena.c.
References ADVANCE_PARSE_POINTER, appendStringInfoCharMacro, arg, ARR_ELEMTYPE, Assert, cstring_to_text_with_len(), DatumGetInt16(), DatumGetInt32(), deconstruct_array(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, fmgr_info(), fmt, get_base_element_type(), get_fn_expr_argtype(), get_fn_expr_variadic(), get_typlenbyvalalign(), getTypeOutputInfo(), initStringInfo(), InvalidOid, nitems, OidIsValid, OutputFunctionCall(), pfree(), PG_ARGISNULL, PG_GETARG_ARRAYTYPE_P, PG_GETARG_DATUM, PG_GETARG_TEXT_PP, pg_mblen(), PG_NARGS, PG_RETURN_NULL, PG_RETURN_TEXT_P, pg_strtoint32(), str, text_format_parse_format(), text_format_string_conversion(), value, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by text_format_nv().
|
static |
Definition at line 6065 of file varlena.c.
References appendStringInfoSpaces(), appendStringInfoString(), buf, ereport, errcode(), errmsg(), ERROR, len, pg_mbstrlen(), str, and TEXT_FORMAT_FLAG_MINUS.
Referenced by text_format_string_conversion().
Datum text_format_nv | ( | PG_FUNCTION_ARGS | ) |
|
static |
Definition at line 5890 of file varlena.c.
References ADVANCE_PARSE_POINTER, ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), pg_mul_s32_overflow(), unlikely, val, and value.
Referenced by text_format_parse_format().
|
static |
Definition at line 5939 of file varlena.c.
References ADVANCE_PARSE_POINTER, ereport, errcode(), errmsg(), ERROR, TEXT_FORMAT_FLAG_MINUS, and text_format_parse_digits().
Referenced by text_format().
|
static |
Definition at line 6016 of file varlena.c.
References buf, ereport, errcode(), errmsg(), ERROR, OutputFunctionCall(), pfree(), quote_identifier(), quote_literal_cstr(), str, text_format_append_string(), and value.
Referenced by text_format().
Datum text_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1760 of file varlena.c.
References PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and text_cmp().
Referenced by gbt_textge().
Datum text_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1745 of file varlena.c.
References PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and text_cmp().
Referenced by gbt_textgt().
Definition at line 4475 of file varlena.c.
References collid, DatumGetBool(), DirectFunctionCall2Coll(), PointerGetDatum(), and texteq().
Referenced by split_text_accum_result().
Datum text_larger | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2546 of file varlena.c.
References PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, and text_cmp().
Datum text_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1730 of file varlena.c.
References PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and text_cmp().
Referenced by gbt_textle().
Datum text_left | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5513 of file varlena.c.
References cstring_to_text_with_len(), len, PG_GETARG_DATUM, PG_GETARG_INT32, PG_GETARG_TEXT_PP, pg_mbcharcliplen(), pg_mbstrlen_with_len(), PG_RETURN_TEXT_P, str, text_substring(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Definition at line 711 of file varlena.c.
References DatumGetTextPP, pg_database_encoding_max_length(), pg_mbstrlen_with_len(), PG_RETURN_INT32, str, toast_raw_datum_size(), VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
Referenced by textlen(), and textoverlay_no_len().
Datum text_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1715 of file varlena.c.
References PG_FREE_IF_COPY, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and text_cmp().
Referenced by gbt_textlt().
Datum text_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3334 of file varlena.c.
References len, NAMEDATALEN, NameStr, palloc0(), PG_GETARG_TEXT_PP, pg_mbcliplen(), PG_RETURN_NAME, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Definition at line 1116 of file varlena.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PointerGetDatum(), s1, s2, text_catenate(), and text_substring().
Referenced by textoverlay(), and textoverlay_no_len().
Datum text_pattern_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2826 of file varlena.c.
References internal_text_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum text_pattern_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2842 of file varlena.c.
References internal_text_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum text_pattern_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2810 of file varlena.c.
References internal_text_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Datum text_pattern_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2794 of file varlena.c.
References internal_text_pattern_compare(), PG_FREE_IF_COPY, PG_GETARG_TEXT_PP, and PG_RETURN_BOOL.
Definition at line 1176 of file varlena.c.
References collid, text_position_cleanup(), text_position_get_match_pos(), text_position_next(), text_position_setup(), and VARSIZE_ANY_EXHDR.
Referenced by textpos().
|
static |
Definition at line 1502 of file varlena.c.
Referenced by replace_text(), split_part(), split_text(), and text_position().
|
static |
Definition at line 1478 of file varlena.c.
References pg_mbstrlen_with_len().
Referenced by text_position().
|
static |
Definition at line 1467 of file varlena.c.
Referenced by replace_text(), split_part(), and split_text().
|
static |
Definition at line 1335 of file varlena.c.
References Assert, pg_mblen(), and text_position_next_internal().
Referenced by replace_text(), split_part(), split_text(), and text_position().
|
static |
|
static |
|
static |
Definition at line 1216 of file varlena.c.
References Assert, check_collation_set(), collid, pg_locale_struct::deterministic, ereport, errcode(), errmsg(), ERROR, for(), GetDatabaseEncoding(), i, pg_database_encoding_max_length(), pg_newlocale_from_collation(), PG_UTF8, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by replace_text(), split_part(), split_text(), and text_position().
Datum text_reverse | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5558 of file varlena.c.
References len, palloc(), pg_database_encoding_max_length(), PG_GETARG_TEXT_PP, pg_mblen(), PG_RETURN_TEXT_P, SET_VARSIZE, str, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
Datum text_right | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5537 of file varlena.c.
References cstring_to_text_with_len(), len, PG_GETARG_INT32, PG_GETARG_TEXT_PP, pg_mbcharcliplen(), pg_mbstrlen_with_len(), PG_RETURN_TEXT_P, str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum text_smaller | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2558 of file varlena.c.
References PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, and text_cmp().
Datum text_starts_with | ( | PG_FUNCTION_ARGS | ) |