|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/detoast.h"#include "common/hashfn.h"#include "common/int.h"#include "fmgr.h"#include "lib/hyperloglog.h"#include "libpq/pqformat.h"#include "port/pg_bitutils.h"#include "port/pg_bswap.h"#include "utils/builtins.h"#include "utils/bytea.h"#include "utils/fmgrprotos.h"#include "utils/guc.h"#include "utils/memutils.h"#include "utils/sortsupport.h"#include "varatt.h"
Go to the source code of this file.
Data Structures | |
| struct | ByteaSortSupport |
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_))) |
|
static |
Definition at line 1151 of file bytea.c.
References ByteaSortSupport::abbr_card, SortSupportData::abbreviate, Assert(), elog, estimateHyperLogLog(), ByteaSortSupport::full_card, LOG, ByteaSortSupport::prop_card, SortSupportData::ssup_extra, and trace_sort.
Referenced by bytea_sortsupport().
|
static |
Definition at line 1058 of file bytea.c.
References ByteaSortSupport::abbr_card, addHyperLogLog(), DatumBigEndianToNative, DatumGetByteaPP, DatumGetUInt32(), DatumGetUInt64(), ByteaSortSupport::full_card, hash(), hash_any(), hash_uint32(), len, Min, pfree(), PG_CACHE_LINE_SIZE, PointerGetDatum(), SortSupportData::ssup_extra, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Referenced by bytea_sortsupport().
| Datum bytea_bit_count | ( | PG_FUNCTION_ARGS | ) |
Definition at line 581 of file bytea.c.
References PG_GETARG_BYTEA_PP, pg_popcount(), PG_RETURN_INT64, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Definition at line 61 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 1250 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 1275 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 1300 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 981 of file bytea.c.
References cmp(), Min, PG_GETARG_BYTEA_PP, PG_RETURN_BYTEA_P, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Definition at line 158 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 788 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 1000 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 1214 of file bytea.c.
References ByteaSortSupport::abbr_card, SortSupportData::abbrev_abort, SortSupportData::abbrev_converter, SortSupportData::abbrev_full_comparator, ByteaSortSupport::abbreviate, SortSupportData::abbreviate, bytea_abbrev_abort(), bytea_abbrev_convert(), byteafastcmp(), SortSupportData::comparator, ByteaSortSupport::full_card, initHyperLogLog(), MemoryContextSwitchTo(), palloc_object, PG_GETARG_POINTER, PG_RETURN_VOID, ByteaSortSupport::prop_card, SortSupportData::ssup_cxt, ssup_datum_unsigned_cmp(), and SortSupportData::ssup_extra.
| Datum bytea_string_agg_finalfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 454 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 385 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 555 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 569 of file bytea.c.
References bytea_substring(), PG_GETARG_DATUM, PG_GETARG_INT32, and PG_RETURN_BYTEA_P.
Definition at line 98 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 501 of file bytea.c.
References bytea_catenate(), PG_GETARG_BYTEA_PP, and PG_RETURN_BYTEA_P.
| Datum byteacmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 959 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 815 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().
|
static |
Definition at line 1022 of file bytea.c.
References DatumGetByteaPP, Min, pfree(), PointerGetDatum(), VARDATA_ANY(), VARSIZE_ANY_EXHDR(), x, and y.
Referenced by bytea_sortsupport().
| Datum byteage | ( | PG_FUNCTION_ARGS | ) |
Definition at line 939 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 668 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 639 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 919 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 201 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 899 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 879 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 847 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 485 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 275 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 517 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 528 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 595 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 358 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 377 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 738 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 706 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 34 of file bytea.c.
Referenced by byteaout().