|
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 "utils/uuid.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_))) |
Definition at line 95 of file bytea.c.
|
static |
Definition at line 1152 of file bytea.c.
References SortSupportData::abbreviate, Assert, elog, estimateHyperLogLog(), fb(), LOG, SortSupportData::ssup_extra, and trace_sort.
Referenced by bytea_sortsupport().
|
static |
Definition at line 1059 of file bytea.c.
References addHyperLogLog(), DatumBigEndianToNative, DatumGetByteaPP, DatumGetUInt32(), DatumGetUInt64(), fb(), 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 582 of file bytea.c.
References fb(), PG_GETARG_BYTEA_PP, pg_popcount(), PG_RETURN_INT64, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Definition at line 62 of file bytea.c.
References fb(), 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 1251 of file bytea.c.
References BITS_PER_BYTE, ereport, errcode(), errmsg, ERROR, fb(), i, len, PG_GETARG_BYTEA_PP, PG_RETURN_INT16, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum bytea_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1276 of file bytea.c.
References BITS_PER_BYTE, ereport, errcode(), errmsg, ERROR, fb(), i, len, PG_GETARG_BYTEA_PP, PG_RETURN_INT32, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum bytea_int8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1301 of file bytea.c.
References BITS_PER_BYTE, ereport, errcode(), errmsg, ERROR, fb(), i, len, PG_GETARG_BYTEA_PP, PG_RETURN_INT64, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum bytea_larger | ( | PG_FUNCTION_ARGS | ) |
Definition at line 982 of file bytea.c.
References cmp(), fb(), Min, PG_GETARG_BYTEA_PP, PG_RETURN_BYTEA_P, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Definition at line 159 of file bytea.c.
References bytea_catenate(), bytea_substring(), ereport, errcode(), errmsg, ERROR, fb(), pg_add_s32_overflow(), PointerGetDatum(), s1, and s2.
Referenced by byteaoverlay(), and byteaoverlay_no_len().
| Datum bytea_reverse | ( | PG_FUNCTION_ARGS | ) |
Definition at line 789 of file bytea.c.
References fb(), 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 1001 of file bytea.c.
References cmp(), fb(), Min, PG_GETARG_BYTEA_PP, PG_RETURN_BYTEA_P, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum bytea_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1215 of file bytea.c.
References SortSupportData::abbrev_abort, SortSupportData::abbrev_converter, SortSupportData::abbrev_full_comparator, SortSupportData::abbreviate, bytea_abbrev_abort(), bytea_abbrev_convert(), byteafastcmp(), SortSupportData::comparator, fb(), initHyperLogLog(), MemoryContextSwitchTo(), palloc_object, PG_GETARG_POINTER, PG_RETURN_VOID, SortSupportData::ssup_cxt, ssup_datum_unsigned_cmp(), and SortSupportData::ssup_extra.
| Datum bytea_string_agg_finalfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 455 of file bytea.c.
References AggCheckCallContext(), Assert, fb(), 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 386 of file bytea.c.
References AggCheckCallContext(), appendBinaryStringInfo(), elog, ERROR, fb(), 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 556 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 570 of file bytea.c.
References bytea_substring(), PG_GETARG_DATUM, PG_GETARG_INT32, and PG_RETURN_BYTEA_P.
Definition at line 99 of file bytea.c.
References DatumGetByteaPSlice, ereport, errcode(), errmsg, ERROR, fb(), Max, pg_add_s32_overflow(), PG_STR_GET_BYTEA, S, and str.
Referenced by bytea_overlay(), bytea_substr(), and bytea_substr_no_len().
| Datum bytea_uuid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1347 of file bytea.c.
References ereport, errcode(), errdetail(), errmsg, ERROR, fb(), len, palloc_object, PG_GETARG_BYTEA_PP, PG_RETURN_UUID_P, UUID_LEN, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum byteacat | ( | PG_FUNCTION_ARGS | ) |
Definition at line 502 of file bytea.c.
References bytea_catenate(), fb(), PG_GETARG_BYTEA_PP, and PG_RETURN_BYTEA_P.
| Datum byteacmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 960 of file bytea.c.
References cmp(), fb(), 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 816 of file bytea.c.
References DatumGetByteaPP, fb(), 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 1023 of file bytea.c.
References DatumGetByteaPP, fb(), Min, pfree(), PointerGetDatum(), VARDATA_ANY(), VARSIZE_ANY_EXHDR(), x, and y.
Referenced by bytea_sortsupport().
| Datum byteage | ( | PG_FUNCTION_ARGS | ) |
Definition at line 940 of file bytea.c.
References cmp(), fb(), 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 669 of file bytea.c.
References ereport, errcode(), errmsg, ERROR, fb(), 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 640 of file bytea.c.
References ereport, errcode(), errmsg, ERROR, fb(), 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 920 of file bytea.c.
References cmp(), fb(), 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 202 of file bytea.c.
References ereturn, errcode(), errmsg, fb(), 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 900 of file bytea.c.
References cmp(), fb(), 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 880 of file bytea.c.
References cmp(), fb(), 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 848 of file bytea.c.
References DatumGetByteaPP, fb(), 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 486 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 276 of file bytea.c.
References bytea_output, BYTEA_OUTPUT_ESCAPE, BYTEA_OUTPUT_HEX, DIG, elog, ereport, errcode(), errmsg_internal(), ERROR, fb(), 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 518 of file bytea.c.
References bytea_overlay(), fb(), PG_GETARG_BYTEA_PP, PG_GETARG_INT32, and PG_RETURN_BYTEA_P.
| Datum byteaoverlay_no_len | ( | PG_FUNCTION_ARGS | ) |
Definition at line 529 of file bytea.c.
References bytea_overlay(), fb(), PG_GETARG_BYTEA_PP, PG_GETARG_INT32, PG_RETURN_BYTEA_P, and VARSIZE_ANY_EXHDR().
| Datum byteapos | ( | PG_FUNCTION_ARGS | ) |
Definition at line 596 of file bytea.c.
References fb(), PG_GETARG_BYTEA_PP, PG_RETURN_INT32, px(), VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum bytearecv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 359 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 378 of file bytea.c.
References fb(), 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 739 of file bytea.c.
References ereport, errcode(), errmsg, ERROR, fb(), 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 707 of file bytea.c.
References ereport, errcode(), errmsg, ERROR, fb(), len, PG_GETARG_BYTEA_P_COPY, PG_GETARG_INT32, PG_RETURN_BYTEA_P, VARDATA(), VARHDRSZ, and VARSIZE().
| Datum int2_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1326 of file bytea.c.
References int2send().
| Datum int4_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1333 of file bytea.c.
References int4send().
| Datum int8_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1340 of file bytea.c.
References int8send().
| Datum uuid_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1366 of file bytea.c.
References uuid_send().
| int bytea_output = BYTEA_OUTPUT_HEX |
Definition at line 35 of file bytea.c.
Referenced by byteaout().