PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "common/int.h"
#include "libpq/pqformat.h"
#include "nodes/nodeFuncs.h"
#include "nodes/supportnodes.h"
#include "port/pg_bitutils.h"
#include "utils/array.h"
#include "utils/fmgrprotos.h"
#include "utils/varbit.h"
Go to the source code of this file.
Macros | |
#define | HEXDIG(z) ((z)<10 ? ((z)+'0') : ((z)-10+'A')) |
#define | VARBIT_PAD(vb) |
#define | VARBIT_PAD_LAST(vb, ptr) |
#define | VARBIT_CORRECTLY_PADDED(vb) ((void) 0) |
#define VARBIT_PAD | ( | vb | ) |
#define VARBIT_PAD_LAST | ( | vb, | |
ptr | |||
) |
Definition at line 90 of file varbit.c.
References ArrayGetIntegerTypmods(), BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, and MaxAttrSize.
Referenced by bittypmodin(), and varbittypmodin().
|
static |
Definition at line 127 of file varbit.c.
References palloc(), res, and snprintf.
Referenced by bittypmodout(), and varbittypmodout().
Datum bit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 391 of file varbit.c.
References arg, ereport, errcode(), errmsg(), ERROR, len, Min, palloc0(), PG_GETARG_BOOL, PG_GETARG_INT32, PG_GETARG_VARBIT_P, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBIT_PAD, VARBITBYTES, VARBITLEN, VARBITMAXLEN, VARBITS, and VARBITTOTALLEN.
Referenced by _hash_addovflpage(), bloom_add_value(), bloom_contains_value(), build_test_info_result(), fill_val(), hash_bitmap_info(), heap_fill_tuple(), RT_GROW_NODE_16(), RT_GROW_NODE_48(), and show_incremental_sort_group_info().
Datum bit_and | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1243 of file varbit.c.
References ereport, errcode(), errmsg(), ERROR, i, len, p2, palloc(), PG_GETARG_VARBIT_P, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBITBYTES, VARBITLEN, VARBITS, and VARSIZE.
Datum bit_bit_count | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1211 of file varbit.c.
References arg, PG_GETARG_VARBIT_P, pg_popcount(), PG_RETURN_INT64, VARBITBYTES, and VARBITS.
Definition at line 977 of file varbit.c.
References BITMASK, BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, palloc(), SET_VARSIZE, VARBITBYTES, VARBITEND, VARBITLEN, VARBITMAXLEN, VARBITPAD, VARBITS, and VARBITTOTALLEN.
Referenced by bit_overlay(), and bitcat().
Definition at line 818 of file varbit.c.
References cmp(), Min, VARBITBYTES, VARBITLEN, and VARBITS.
Referenced by bitcmp(), biteq(), bitge(), bitgt(), bitle(), bitlt(), and bitne().
Datum bit_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 147 of file varbit.c.
References ereturn, errcode(), errmsg(), HIGHBIT, len, palloc0(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_GETARG_OID, pg_mblen(), PG_RETURN_VARBIT_P, SET_VARSIZE, VARBITLEN, VARBITMAXLEN, VARBITS, VARBITTOTALLEN, and x.
Referenced by leftmostvalue_bit(), and make_const().
Datum bit_or | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1284 of file varbit.c.
References ereport, errcode(), errmsg(), ERROR, i, len, p2, palloc(), PG_GETARG_VARBIT_P, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBITBYTES, VARBITLEN, VARBITS, and VARSIZE.
Datum bit_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 280 of file varbit.c.
References HEXDIG, i, len, palloc(), PG_GETARG_VARBIT_P, PG_RETURN_CSTRING, VARBIT_CORRECTLY_PADDED, varbit_out(), VARBITLEN, and VARBITS.
Definition at line 1176 of file varbit.c.
References bit_catenate(), bitsubstring(), ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), s1, and s2.
Referenced by bitoverlay(), and bitoverlay_no_len().
Datum bit_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 331 of file varbit.c.
References buf, ereport, errcode(), errmsg(), ERROR, len, palloc(), PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_VARBIT_P, pq_copymsgbytes(), pq_getmsgint(), SET_VARSIZE, VARBIT_PAD, VARBITBYTES, VARBITLEN, VARBITMAXLEN, VARBITS, and VARBITTOTALLEN.
Datum bit_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 376 of file varbit.c.
References varbit_send().
Datum bitcat | ( | PG_FUNCTION_ARGS | ) |
Definition at line 968 of file varbit.c.
References bit_catenate(), PG_GETARG_VARBIT_P, and PG_RETURN_VARBIT_P.
Datum bitcmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 949 of file varbit.c.
References bit_cmp(), PG_FREE_IF_COPY, PG_GETARG_VARBIT_P, and PG_RETURN_INT32.
Datum biteq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 841 of file varbit.c.
References bit_cmp(), PG_FREE_IF_COPY, PG_GETARG_VARBIT_P, PG_RETURN_BOOL, and VARBITLEN.
Referenced by gbt_biteq().
Datum bitfromint4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1531 of file varbit.c.
References a, BITMASK, Min, palloc(), PG_GETARG_INT32, PG_RETURN_VARBIT_P, SET_VARSIZE, val, VARBITLEN, VARBITMAXLEN, VARBITS, and VARBITTOTALLEN.
Datum bitfromint8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1611 of file varbit.c.
References a, BITMASK, Min, palloc(), PG_GETARG_INT32, PG_GETARG_INT64, PG_RETURN_VARBIT_P, SET_VARSIZE, val, VARBITLEN, VARBITMAXLEN, VARBITS, and VARBITTOTALLEN.
Datum bitge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 934 of file varbit.c.
References bit_cmp(), PG_FREE_IF_COPY, PG_GETARG_VARBIT_P, and PG_RETURN_BOOL.
Referenced by gbt_bitge().
Datum bitgetbit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1869 of file varbit.c.
References BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, PG_GETARG_VARBIT_P, PG_RETURN_INT32, VARBITLEN, and VARBITS.
Datum bitgt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 919 of file varbit.c.
References bit_cmp(), PG_FREE_IF_COPY, PG_GETARG_VARBIT_P, and PG_RETURN_BOOL.
Referenced by gbt_bitgt().
Datum bitle | ( | PG_FUNCTION_ARGS | ) |
Definition at line 904 of file varbit.c.
References bit_cmp(), PG_FREE_IF_COPY, PG_GETARG_VARBIT_P, and PG_RETURN_BOOL.
Referenced by gbt_bitle().
Datum bitlength | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1223 of file varbit.c.
References arg, PG_GETARG_VARBIT_P, PG_RETURN_INT32, and VARBITLEN.
Datum bitlt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 889 of file varbit.c.
References bit_cmp(), PG_FREE_IF_COPY, PG_GETARG_VARBIT_P, and PG_RETURN_BOOL.
Referenced by gbt_bitlt().
Datum bitne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 865 of file varbit.c.
References bit_cmp(), PG_FREE_IF_COPY, PG_GETARG_VARBIT_P, PG_RETURN_BOOL, and VARBITLEN.
Datum bitnot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1365 of file varbit.c.
References arg, palloc(), PG_GETARG_VARBIT_P, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBIT_PAD_LAST, VARBITEND, VARBITLEN, VARBITS, and VARSIZE.
Datum bitoctetlength | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1231 of file varbit.c.
References arg, PG_GETARG_VARBIT_P, PG_RETURN_INT32, and VARBITBYTES.
Datum bitoverlay | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1153 of file varbit.c.
References bit_overlay(), PG_GETARG_INT32, PG_GETARG_VARBIT_P, and PG_RETURN_VARBIT_P.
Datum bitoverlay_no_len | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1164 of file varbit.c.
References bit_overlay(), PG_GETARG_INT32, PG_GETARG_VARBIT_P, PG_RETURN_VARBIT_P, and VARBITLEN.
Datum bitposition | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1698 of file varbit.c.
References BITMASK, BITS_PER_BYTE, cmp(), DEBUG4, elog, i, PG_GETARG_VARBIT_P, PG_RETURN_INT32, str, VARBITBYTES, VARBITEND, VARBITLEN, VARBITPAD, and VARBITS.
Datum bitsetbit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1807 of file varbit.c.
References BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, len, palloc(), PG_GETARG_INT32, PG_GETARG_VARBIT_P, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBITBYTES, VARBITLEN, VARBITS, and VARSIZE.
Datum bitshiftleft | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1392 of file varbit.c.
References arg, BITS_PER_BYTE, bitshiftright(), DirectFunctionCall2, Int32GetDatum(), len, MemSet, palloc(), PG_GETARG_INT32, PG_GETARG_VARBIT_P, PG_RETURN_DATUM, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBITBYTES, VARBITEND, VARBITLEN, VARBITMAXLEN, VarBitPGetDatum(), VARBITS, and VARSIZE.
Referenced by bitshiftright().
Datum bitshiftright | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1459 of file varbit.c.
References arg, BITMASK, BITS_PER_BYTE, bitshiftleft(), DirectFunctionCall2, Int32GetDatum(), len, MemSet, palloc(), PG_GETARG_INT32, PG_GETARG_VARBIT_P, PG_RETURN_DATUM, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBIT_PAD_LAST, VARBITBYTES, VARBITEND, VARBITLEN, VARBITMAXLEN, VarBitPGetDatum(), VARBITS, and VARSIZE.
Referenced by bitshiftleft().
Datum bitsubstr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1038 of file varbit.c.
References bitsubstring(), PG_GETARG_INT32, PG_GETARG_VARBIT_P, and PG_RETURN_VARBIT_P.
Datum bitsubstr_no_len | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1047 of file varbit.c.
References bitsubstring(), PG_GETARG_INT32, PG_GETARG_VARBIT_P, and PG_RETURN_VARBIT_P.
Definition at line 1055 of file varbit.c.
References arg, BITMASK, BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, i, len, Max, Min, palloc(), pg_add_s32_overflow(), ps, s1, SET_VARSIZE, VARBIT_PAD, VARBITEND, VARBITHDRSZ, VARBITLEN, VARBITS, VARBITTOTALLEN, and VARHDRSZ.
Referenced by bit_overlay(), bitsubstr(), and bitsubstr_no_len().
Datum bittoint4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1586 of file varbit.c.
References arg, BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, PG_GETARG_VARBIT_P, PG_RETURN_INT32, VARBITEND, VARBITLEN, VARBITPAD, and VARBITS.
Datum bittoint8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1666 of file varbit.c.
References arg, BITS_PER_BYTE, ereport, errcode(), errmsg(), ERROR, PG_GETARG_VARBIT_P, PG_RETURN_INT64, VARBITEND, VARBITLEN, VARBITPAD, and VARBITS.
Datum bittypmodin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 429 of file varbit.c.
References anybit_typmodin(), PG_GETARG_ARRAYTYPE_P, and PG_RETURN_INT32.
Datum bittypmodout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 437 of file varbit.c.
References anybit_typmodout(), PG_GETARG_INT32, and PG_RETURN_CSTRING.
Datum bitxor | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1324 of file varbit.c.
References ereport, errcode(), errmsg(), ERROR, i, len, p2, palloc(), PG_GETARG_VARBIT_P, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBITBYTES, VARBITLEN, VARBITS, and VARSIZE.
Datum varbit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 742 of file varbit.c.
References arg, ereport, errcode(), errmsg(), ERROR, len, palloc(), PG_GETARG_BOOL, PG_GETARG_INT32, PG_GETARG_VARBIT_P, PG_RETURN_VARBIT_P, SET_VARSIZE, VARBIT_PAD, VARBITBYTES, VARBITLEN, VARBITS, and VARBITTOTALLEN.
Datum varbit_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 452 of file varbit.c.
References ereturn, errcode(), errmsg(), HIGHBIT, len, Min, palloc0(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_GETARG_OID, pg_mblen(), PG_RETURN_VARBIT_P, SET_VARSIZE, VARBITLEN, VARBITMAXLEN, VARBITS, VARBITTOTALLEN, and x.
Referenced by leftmostvalue_varbit().
Datum varbit_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 587 of file varbit.c.
References BITS_PER_BYTE, i, IS_HIGHBIT_SET, len, palloc(), PG_GETARG_VARBIT_P, PG_RETURN_CSTRING, VARBIT_CORRECTLY_PADDED, VARBITLEN, VARBITS, and x.
Referenced by bit_out().
Datum varbit_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 636 of file varbit.c.
References buf, ereport, errcode(), errmsg(), ERROR, len, palloc(), PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_VARBIT_P, pq_copymsgbytes(), pq_getmsgint(), SET_VARSIZE, VARBIT_PAD, VARBITBYTES, VARBITLEN, VARBITMAXLEN, VARBITS, and VARBITTOTALLEN.
Datum varbit_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 681 of file varbit.c.
References buf, PG_GETARG_VARBIT_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendbytes(), pq_sendint32(), VARBITBYTES, VARBITLEN, and VARBITS.
Referenced by bit_send().
Datum varbit_support | ( | PG_FUNCTION_ARGS | ) |
Definition at line 702 of file varbit.c.
References FuncExpr::args, Assert, DatumGetInt32(), exprTypmod(), SupportRequestSimplify::fcall, IsA, linitial, list_length(), lsecond, PG_GETARG_POINTER, PG_RETURN_POINTER, relabel_to_typmod(), and source.
Datum varbittypmodin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 774 of file varbit.c.
References anybit_typmodin(), PG_GETARG_ARRAYTYPE_P, and PG_RETURN_INT32.
Datum varbittypmodout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 782 of file varbit.c.
References anybit_typmodout(), PG_GETARG_INT32, and PG_RETURN_CSTRING.