PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/detoast.h"
#include "catalog/pg_collation_d.h"
#include "catalog/pg_type_d.h"
#include "common/int.h"
#include "fmgr.h"
#include "libpq/pqformat.h"
#include "port/pg_bitutils.h"
#include "utils/builtins.h"
#include "utils/bytea.h"
#include "utils/fmgrprotos.h"
#include "utils/memutils.h"
#include "utils/sortsupport.h"
#include "utils/varlena.h"
#include "varatt.h"
Go to the source code of this file.
Macros | |
#define | PG_STR_GET_BYTEA(str_) DatumGetByteaPP(DirectFunctionCall1(byteain, CStringGetDatum(str_))) |
#define | VAL(CH) ((CH) - '0') |
#define | DIG(VAL) ((VAL) + '0') |
Variables | |
int | bytea_output = BYTEA_OUTPUT_HEX |
#define PG_STR_GET_BYTEA | ( | str_ | ) | DatumGetByteaPP(DirectFunctionCall1(byteain, CStringGetDatum(str_))) |
Datum bytea_bit_count | ( | PG_FUNCTION_ARGS | ) |
Definition at line 567 of file bytea.c.
References PG_GETARG_BYTEA_PP, pg_popcount(), PG_RETURN_INT64, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Definition at line 47 of file bytea.c.
References len, palloc(), SET_VARSIZE(), VARDATA(), VARDATA_ANY(), VARHDRSZ, and VARSIZE_ANY_EXHDR().
Referenced by bytea_overlay(), and byteacat().
Datum bytea_int2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1022 of file bytea.c.
References BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, i, len, PG_GETARG_BYTEA_PP, PG_RETURN_INT16, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Datum bytea_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1047 of file bytea.c.
References BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, i, len, PG_GETARG_BYTEA_PP, PG_RETURN_INT32, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Datum bytea_int8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1072 of file bytea.c.
References BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, i, len, PG_GETARG_BYTEA_PP, PG_RETURN_INT64, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Datum bytea_larger | ( | PG_FUNCTION_ARGS | ) |
Definition at line 967 of file bytea.c.
References cmp(), Min, PG_GETARG_BYTEA_PP, PG_RETURN_BYTEA_P, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Definition at line 144 of file bytea.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_reverse | ( | PG_FUNCTION_ARGS | ) |
Definition at line 774 of file bytea.c.
References len, palloc(), PG_GETARG_BYTEA_PP, PG_RETURN_BYTEA_P, SET_VARSIZE(), VARDATA(), VARDATA_ANY(), VARHDRSZ, and VARSIZE_ANY_EXHDR().
Datum bytea_smaller | ( | PG_FUNCTION_ARGS | ) |
Definition at line 986 of file bytea.c.
References cmp(), Min, PG_GETARG_BYTEA_PP, PG_RETURN_BYTEA_P, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Datum bytea_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1005 of file bytea.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 440 of file bytea.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 371 of file bytea.c.
References AggCheckCallContext(), appendBinaryStringInfo(), elog, ERROR, makeStringInfo(), MemoryContextSwitchTo(), 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 541 of file bytea.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 555 of file bytea.c.
References bytea_substring(), PG_GETARG_DATUM, PG_GETARG_INT32, and PG_RETURN_BYTEA_P.
Definition at line 84 of file bytea.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 487 of file bytea.c.
References bytea_catenate(), PG_GETARG_BYTEA_PP, and PG_RETURN_BYTEA_P.
Datum byteacmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 945 of file bytea.c.
References cmp(), Min, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_RETURN_INT32, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Referenced by gbt_bit_ssup_cmp(), gbt_bitcmp(), gbt_bytea_ssup_cmp(), and gbt_byteacmp().
Datum byteaeq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 801 of file bytea.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 925 of file bytea.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 654 of file bytea.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 625 of file bytea.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 905 of file bytea.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 187 of file bytea.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 885 of file bytea.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 865 of file bytea.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 833 of file bytea.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 471 of file bytea.c.
References PG_GETARG_DATUM, PG_RETURN_INT32, str, toast_raw_datum_size(), and VARHDRSZ.
Datum byteaout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 261 of file bytea.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 503 of file bytea.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 514 of file bytea.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 581 of file bytea.c.
References PG_GETARG_BYTEA_PP, PG_RETURN_INT32, px(), VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Datum bytearecv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 344 of file bytea.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 363 of file bytea.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 724 of file bytea.c.
References ereport, errcode(), errmsg(), ERROR, len, PG_GETARG_BYTEA_P_COPY, PG_GETARG_INT32, PG_GETARG_INT64, PG_RETURN_BYTEA_P, VARDATA(), VARHDRSZ, and VARSIZE().
Datum byteaSetByte | ( | PG_FUNCTION_ARGS | ) |
Definition at line 692 of file bytea.c.
References ereport, errcode(), errmsg(), ERROR, len, PG_GETARG_BYTEA_P_COPY, PG_GETARG_INT32, PG_RETURN_BYTEA_P, VARDATA(), VARHDRSZ, and VARSIZE().
Datum int2_bytea | ( | PG_FUNCTION_ARGS | ) |
Datum int4_bytea | ( | PG_FUNCTION_ARGS | ) |
Datum int8_bytea | ( | PG_FUNCTION_ARGS | ) |
int bytea_output = BYTEA_OUTPUT_HEX |
Definition at line 33 of file bytea.c.
Referenced by byteaout().