PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | ArrayType |
struct | ExpandedArrayHeader |
union | AnyArrayType |
struct | ArrayBuildState |
struct | ArrayBuildStateArr |
struct | ArrayBuildStateAny |
struct | ArrayMetaState |
struct | ArrayMapState |
Typedefs | |
typedef struct ArrayType | ArrayType |
typedef struct ExpandedArrayHeader | ExpandedArrayHeader |
typedef union AnyArrayType | AnyArrayType |
typedef struct ArrayBuildState | ArrayBuildState |
typedef struct ArrayBuildStateArr | ArrayBuildStateArr |
typedef struct ArrayBuildStateAny | ArrayBuildStateAny |
typedef struct ArrayMetaState | ArrayMetaState |
typedef struct ArrayMapState | ArrayMapState |
typedef struct ArrayIteratorData * | ArrayIterator |
Functions | |
void | CopyArrayEls (ArrayType *array, Datum *values, bool *nulls, int nitems, int typlen, bool typbyval, char typalign, bool freedata) |
Datum | array_get_element (Datum arraydatum, int nSubscripts, int *indx, int arraytyplen, int elmlen, bool elmbyval, char elmalign, bool *isNull) |
Datum | array_set_element (Datum arraydatum, int nSubscripts, int *indx, Datum dataValue, bool isNull, int arraytyplen, int elmlen, bool elmbyval, char elmalign) |
Datum | array_get_slice (Datum arraydatum, int nSubscripts, int *upperIndx, int *lowerIndx, bool *upperProvided, bool *lowerProvided, int arraytyplen, int elmlen, bool elmbyval, char elmalign) |
Datum | array_set_slice (Datum arraydatum, int nSubscripts, int *upperIndx, int *lowerIndx, bool *upperProvided, bool *lowerProvided, Datum srcArrayDatum, bool isNull, int arraytyplen, int elmlen, bool elmbyval, char elmalign) |
Datum | array_ref (ArrayType *array, int nSubscripts, int *indx, int arraytyplen, int elmlen, bool elmbyval, char elmalign, bool *isNull) |
ArrayType * | array_set (ArrayType *array, int nSubscripts, int *indx, Datum dataValue, bool isNull, int arraytyplen, int elmlen, bool elmbyval, char elmalign) |
Datum | array_map (Datum arrayd, struct ExprState *exprstate, struct ExprContext *econtext, Oid retType, ArrayMapState *amstate) |
void | array_bitmap_copy (bits8 *destbitmap, int destoffset, const bits8 *srcbitmap, int srcoffset, int nitems) |
ArrayType * | construct_array (Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign) |
ArrayType * | construct_array_builtin (Datum *elems, int nelems, Oid elmtype) |
ArrayType * | construct_md_array (Datum *elems, bool *nulls, int ndims, int *dims, int *lbs, Oid elmtype, int elmlen, bool elmbyval, char elmalign) |
ArrayType * | construct_empty_array (Oid elmtype) |
ExpandedArrayHeader * | construct_empty_expanded_array (Oid element_type, MemoryContext parentcontext, ArrayMetaState *metacache) |
void | deconstruct_array (ArrayType *array, Oid elmtype, int elmlen, bool elmbyval, char elmalign, Datum **elemsp, bool **nullsp, int *nelemsp) |
void | deconstruct_array_builtin (ArrayType *array, Oid elmtype, Datum **elemsp, bool **nullsp, int *nelemsp) |
bool | array_contains_nulls (ArrayType *array) |
ArrayBuildState * | initArrayResult (Oid element_type, MemoryContext rcontext, bool subcontext) |
ArrayBuildState * | initArrayResultWithSize (Oid element_type, MemoryContext rcontext, bool subcontext, int initsize) |
ArrayBuildState * | accumArrayResult (ArrayBuildState *astate, Datum dvalue, bool disnull, Oid element_type, MemoryContext rcontext) |
Datum | makeArrayResult (ArrayBuildState *astate, MemoryContext rcontext) |
Datum | makeMdArrayResult (ArrayBuildState *astate, int ndims, int *dims, int *lbs, MemoryContext rcontext, bool release) |
ArrayBuildStateArr * | initArrayResultArr (Oid array_type, Oid element_type, MemoryContext rcontext, bool subcontext) |
ArrayBuildStateArr * | accumArrayResultArr (ArrayBuildStateArr *astate, Datum dvalue, bool disnull, Oid array_type, MemoryContext rcontext) |
Datum | makeArrayResultArr (ArrayBuildStateArr *astate, MemoryContext rcontext, bool release) |
ArrayBuildStateAny * | initArrayResultAny (Oid input_type, MemoryContext rcontext, bool subcontext) |
ArrayBuildStateAny * | accumArrayResultAny (ArrayBuildStateAny *astate, Datum dvalue, bool disnull, Oid input_type, MemoryContext rcontext) |
Datum | makeArrayResultAny (ArrayBuildStateAny *astate, MemoryContext rcontext, bool release) |
ArrayIterator | array_create_iterator (ArrayType *arr, int slice_ndim, ArrayMetaState *mstate) |
bool | array_iterate (ArrayIterator iterator, Datum *value, bool *isnull) |
void | array_free_iterator (ArrayIterator iterator) |
int | ArrayGetOffset (int n, const int *dim, const int *lb, const int *indx) |
int | ArrayGetNItems (int ndim, const int *dims) |
int | ArrayGetNItemsSafe (int ndim, const int *dims, struct Node *escontext) |
void | ArrayCheckBounds (int ndim, const int *dims, const int *lb) |
bool | ArrayCheckBoundsSafe (int ndim, const int *dims, const int *lb, struct Node *escontext) |
void | mda_get_range (int n, int *span, const int *st, const int *endp) |
void | mda_get_prod (int n, const int *range, int *prod) |
void | mda_get_offset_values (int n, int *dist, const int *prod, const int *span) |
int | mda_next_tuple (int n, int *curr, const int *span) |
int32 * | ArrayGetIntegerTypmods (ArrayType *arr, int *n) |
Datum | expand_array (Datum arraydatum, MemoryContext parentcontext, ArrayMetaState *metacache) |
ExpandedArrayHeader * | DatumGetExpandedArray (Datum d) |
ExpandedArrayHeader * | DatumGetExpandedArrayX (Datum d, ArrayMetaState *metacache) |
AnyArrayType * | DatumGetAnyArrayP (Datum d) |
void | deconstruct_expanded_array (ExpandedArrayHeader *eah) |
Variables | |
PGDLLIMPORT bool | Array_nulls |
#define AARR_DIMS | ( | a | ) |
#define AARR_ELEMTYPE | ( | a | ) |
#define AARR_HASNULL | ( | a | ) |
#define AARR_LBOUND | ( | a | ) |
#define AARR_NDIM | ( | a | ) |
#define ARR_DATA_OFFSET | ( | a | ) | (ARR_HASNULL(a) ? (a)->dataoffset : ARR_OVERHEAD_NONULLS(ARR_NDIM(a))) |
#define ARR_DATA_PTR | ( | a | ) | (((char *) (a)) + ARR_DATA_OFFSET(a)) |
#define ARR_LBOUND | ( | a | ) |
#define ARR_NULLBITMAP | ( | a | ) |
#define ARR_OVERHEAD_WITHNULLS | ( | ndims, | |
nitems | |||
) |
#define DatumGetArrayTypeP | ( | X | ) | ((ArrayType *) PG_DETOAST_DATUM(X)) |
#define DatumGetArrayTypePCopy | ( | X | ) | ((ArrayType *) PG_DETOAST_DATUM_COPY(X)) |
#define EA_MAGIC 689375833 /* ID for debugging crosschecks */ |
#define MaxArraySize ((Size) (MaxAllocSize / sizeof(Datum))) |
#define PG_GETARG_ANY_ARRAY_P | ( | n | ) | DatumGetAnyArrayP(PG_GETARG_DATUM(n)) |
#define PG_GETARG_ARRAYTYPE_P | ( | n | ) | DatumGetArrayTypeP(PG_GETARG_DATUM(n)) |
#define PG_GETARG_ARRAYTYPE_P_COPY | ( | n | ) | DatumGetArrayTypePCopy(PG_GETARG_DATUM(n)) |
#define PG_GETARG_EXPANDED_ARRAY | ( | n | ) | DatumGetExpandedArray(PG_GETARG_DATUM(n)) |
#define PG_GETARG_EXPANDED_ARRAYX | ( | n, | |
metacache | |||
) | DatumGetExpandedArrayX(PG_GETARG_DATUM(n), metacache) |
#define PG_RETURN_ARRAYTYPE_P | ( | x | ) | PG_RETURN_POINTER(x) |
#define PG_RETURN_EXPANDED_ARRAY | ( | x | ) | PG_RETURN_DATUM(EOHPGetRWDatum(&(x)->hdr)) |
typedef union AnyArrayType AnyArrayType |
typedef struct ArrayBuildState ArrayBuildState |
typedef struct ArrayBuildStateAny ArrayBuildStateAny |
typedef struct ArrayBuildStateArr ArrayBuildStateArr |
typedef struct ArrayIteratorData* ArrayIterator |
typedef struct ArrayMapState ArrayMapState |
typedef struct ArrayMetaState ArrayMetaState |
typedef struct ExpandedArrayHeader ExpandedArrayHeader |
ArrayBuildState* accumArrayResult | ( | ArrayBuildState * | astate, |
Datum | dvalue, | ||
bool | disnull, | ||
Oid | element_type, | ||
MemoryContext | rcontext | ||
) |
Definition at line 5350 of file arrayfuncs.c.
References ArrayBuildState::alen, AllocSizeIsValid, Assert, datumCopy(), ArrayBuildState::dnulls, ArrayBuildState::dvalues, ArrayBuildState::element_type, ereport, errcode(), errmsg(), ERROR, initArrayResult(), MaxAllocSize, ArrayBuildState::mcontext, MemoryContextSwitchTo(), ArrayBuildState::nelems, PG_DETOAST_DATUM_COPY, PointerGetDatum(), repalloc(), ArrayBuildState::typbyval, and ArrayBuildState::typlen.
Referenced by accumArrayResultAny(), array_agg_transfn(), array_positions(), array_to_datum_internal(), brin_minmax_multi_summary_out(), daitch_mokotoff_coding(), dblink_get_connections(), find_or_create_child_node(), multirange_agg_transfn(), optionListToArray(), parse_ident(), pg_get_statisticsobjdef_expressions(), pg_stats_ext_mcvlist_items(), PLySequence_ToArray_recurse(), populate_array_element(), range_agg_transfn(), regexp_split_to_array(), serialize_expr_stats(), split_text_accum_result(), transformRelOptions(), and tuple_data_split_internal().
ArrayBuildStateAny* accumArrayResultAny | ( | ArrayBuildStateAny * | astate, |
Datum | dvalue, | ||
bool | disnull, | ||
Oid | input_type, | ||
MemoryContext | rcontext | ||
) |
Definition at line 5827 of file arrayfuncs.c.
References accumArrayResult(), accumArrayResultArr(), ArrayBuildStateAny::arraystate, initArrayResultAny(), and ArrayBuildStateAny::scalarstate.
Referenced by ExecScanSubPlan(), and ExecSetParamPlan().
ArrayBuildStateArr* accumArrayResultArr | ( | ArrayBuildStateArr * | astate, |
Datum | dvalue, | ||
bool | disnull, | ||
Oid | array_type, | ||
MemoryContext | rcontext | ||
) |
Definition at line 5550 of file arrayfuncs.c.
References ArrayBuildStateArr::abytes, ArrayBuildStateArr::aitems, arg, ARR_DATA_OFFSET, ARR_DATA_PTR, ARR_DIMS, ARR_HASNULL, ARR_LBOUND, ARR_NDIM, ARR_NULLBITMAP, ARR_SIZE, array_bitmap_copy(), ArrayBuildStateArr::array_type, ArrayGetNItems(), Assert, ArrayBuildStateArr::data, data, DatumGetArrayTypeP, DatumGetPointer(), ArrayBuildStateArr::dims, ereport, errcode(), errmsg(), ERROR, i, initArrayResultArr(), InvalidOid, ArrayBuildStateArr::lbs, Max, MAXDIM, ArrayBuildStateArr::mcontext, MemoryContextSwitchTo(), ArrayBuildStateArr::nbytes, ArrayBuildStateArr::ndims, ArrayBuildStateArr::nitems, nitems, ArrayBuildStateArr::nullbitmap, palloc(), pfree(), pg_nextpower2_32(), and repalloc().
Referenced by accumArrayResultAny(), and array_agg_array_transfn().
void array_bitmap_copy | ( | bits8 * | destbitmap, |
int | destoffset, | ||
const bits8 * | srcbitmap, | ||
int | srcoffset, | ||
int | nitems | ||
) |
Definition at line 4966 of file arrayfuncs.c.
References Assert, and nitems.
Referenced by accumArrayResultArr(), array_agg_array_combine(), array_cat(), array_extract_slice(), array_insert_slice(), array_set_element(), array_set_slice(), ExecEvalArrayExpr(), and makeArrayResultArr().
Definition at line 3767 of file arrayfuncs.c.
References ARR_DIMS, ARR_HASNULL, ARR_NDIM, ARR_NULLBITMAP, and ArrayGetNItems().
Referenced by _arrq_cons(), _lca(), _lt_q_regex(), _ltree_compress(), array_fill_internal(), array_iterator(), array_position_common(), array_positions(), ArrayGetIntegerTypmods(), arrq_cons(), cube_a_f8(), cube_a_f8_f8(), cube_subset(), get_jsonb_path_all(), get_path_all(), getWeights(), lt_q_regex(), pg_isolation_test_session_is_blocked(), pg_logical_slot_get_changes_guts(), sanity_check_array(), sanity_check_tid_array(), stats_check_arg_array(), text_to_stavalues(), width_bucket_array(), and worker_spi_launch().
ArrayIterator array_create_iterator | ( | ArrayType * | arr, |
int | slice_ndim, | ||
ArrayMetaState * | mstate | ||
) |
Definition at line 4597 of file arrayfuncs.c.
References ArrayIteratorData::arr, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, ARR_NULLBITMAP, ArrayGetNItems(), Assert, ArrayIteratorData::current_item, ArrayIteratorData::data_ptr, ArrayMetaState::element_type, elog, ERROR, get_typlenbyvalalign(), ArrayIteratorData::nitems, ArrayIteratorData::nullbitmap, palloc(), palloc0(), PointerIsValid, ArrayIteratorData::slice_dims, ArrayIteratorData::slice_lbound, ArrayIteratorData::slice_len, ArrayIteratorData::slice_ndim, ArrayIteratorData::slice_nulls, ArrayIteratorData::slice_values, ArrayIteratorData::typalign, ArrayMetaState::typalign, ArrayIteratorData::typbyval, ArrayMetaState::typbyval, ArrayIteratorData::typlen, and ArrayMetaState::typlen.
Referenced by array_position_common(), array_positions(), and exec_stmt_foreach_a().
void array_free_iterator | ( | ArrayIterator | iterator | ) |
Definition at line 4759 of file arrayfuncs.c.
References pfree(), ArrayIteratorData::slice_ndim, ArrayIteratorData::slice_nulls, and ArrayIteratorData::slice_values.
Referenced by array_position_common(), and array_positions().
Datum array_get_element | ( | Datum | arraydatum, |
int | nSubscripts, | ||
int * | indx, | ||
int | arraytyplen, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign, | ||
bool * | isNull | ||
) |
Definition at line 1820 of file arrayfuncs.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_LBOUND, ARR_NDIM, ARR_NULLBITMAP, array_get_element_expanded(), array_get_isnull(), array_seek(), ArrayCast(), ArrayGetOffset(), DatumGetArrayTypeP, DatumGetPointer(), i, MAXDIM, and VARATT_IS_EXTERNAL_EXPANDED.
Referenced by array_ref(), array_subscript_fetch(), array_subscript_fetch_old(), ATExecAlterColumnType(), and RelationBuildTupleDesc().
Datum array_get_slice | ( | Datum | arraydatum, |
int | nSubscripts, | ||
int * | upperIndx, | ||
int * | lowerIndx, | ||
bool * | upperProvided, | ||
bool * | lowerProvided, | ||
int | arraytyplen, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign | ||
) |
Definition at line 2030 of file arrayfuncs.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, ARR_NULLBITMAP, ARR_OVERHEAD_NONULLS, ARR_OVERHEAD_WITHNULLS, array_extract_slice(), array_slice_size(), ArrayGetNItems(), construct_empty_array(), ArrayType::dataoffset, DatumGetArrayTypeP, DatumGetPointer(), ArrayType::elemtype, ereport, errcode(), errmsg(), ERROR, i, InvalidOid, MAXDIM, mda_get_range(), ArrayType::ndim, palloc0(), PointerGetDatum(), and SET_VARSIZE.
Referenced by array_subscript_fetch_old_slice(), array_subscript_fetch_slice(), and trim_array().
bool array_iterate | ( | ArrayIterator | iterator, |
Datum * | value, | ||
bool * | isnull | ||
) |
Definition at line 4676 of file arrayfuncs.c.
References ArrayIteratorData::arr, ARR_ELEMTYPE, array_get_isnull(), att_addlength_pointer, att_align_nominal, construct_md_array(), ArrayIteratorData::current_item, ArrayIteratorData::data_ptr, fetch_att(), i, ArrayIteratorData::nitems, ArrayIteratorData::nullbitmap, PointerGetDatum(), ArrayIteratorData::slice_dims, ArrayIteratorData::slice_lbound, ArrayIteratorData::slice_len, ArrayIteratorData::slice_ndim, ArrayIteratorData::slice_nulls, ArrayIteratorData::slice_values, ArrayIteratorData::typalign, ArrayIteratorData::typbyval, ArrayIteratorData::typlen, value, and values.
Referenced by array_position_common(), array_positions(), and exec_stmt_foreach_a().
Datum array_map | ( | Datum | arrayd, |
struct ExprState * | exprstate, | ||
struct ExprContext * | econtext, | ||
Oid | retType, | ||
ArrayMapState * | amstate | ||
) |
Definition at line 3201 of file arrayfuncs.c.
References AARR_DIMS, AARR_ELEMTYPE, AARR_LBOUND, AARR_NDIM, AllocSizeIsValid, ARR_DIMS, ARR_LBOUND, ARR_OVERHEAD_NONULLS, ARR_OVERHEAD_WITHNULLS, array_iter_next(), array_iter_setup(), ArrayGetNItems(), att_addlength_datum, att_align_nominal, construct_empty_array(), CopyArrayEls(), ArrayType::dataoffset, DatumGetAnyArrayP(), ArrayMetaState::element_type, ArrayType::elemtype, ereport, errcode(), errmsg(), ERROR, ExecEvalExpr(), get_typlenbyvalalign(), i, ExprState::innermost_casenull, ExprState::innermost_caseval, ArrayMapState::inp_extra, MaxAllocSize, ArrayType::ndim, nitems, palloc(), palloc0(), pfree(), PG_DETOAST_DATUM, PointerGetDatum(), ArrayMapState::ret_extra, SET_VARSIZE, typalign, ArrayMetaState::typalign, ArrayMetaState::typbyval, ArrayMetaState::typlen, and values.
Referenced by ExecEvalArrayCoerce().
Datum array_ref | ( | ArrayType * | array, |
int | nSubscripts, | ||
int * | indx, | ||
int | arraytyplen, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign, | ||
bool * | isNull | ||
) |
Definition at line 3146 of file arrayfuncs.c.
References array_get_element(), and PointerGetDatum().
Referenced by GUCArrayAdd(), GUCArrayDelete(), GUCArrayReset(), pg_get_functiondef(), and TransformGUCArray().
ArrayType* array_set | ( | ArrayType * | array, |
int | nSubscripts, | ||
int * | indx, | ||
Datum | dataValue, | ||
bool | isNull, | ||
int | arraytyplen, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign | ||
) |
Definition at line 3163 of file arrayfuncs.c.
References array_set_element(), DatumGetArrayTypeP, and PointerGetDatum().
Referenced by GUCArrayAdd(), GUCArrayDelete(), GUCArrayReset(), and pg_extension_config_dump().
Datum array_set_element | ( | Datum | arraydatum, |
int | nSubscripts, | ||
int * | indx, | ||
Datum | dataValue, | ||
bool | isNull, | ||
int | arraytyplen, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign | ||
) |
Definition at line 2201 of file arrayfuncs.c.
References ARR_DATA_OFFSET, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_LBOUND, ARR_NDIM, ARR_NULLBITMAP, ARR_OVERHEAD_NONULLS, ARR_OVERHEAD_WITHNULLS, ARR_SIZE, array_bitmap_copy(), array_get_isnull(), array_seek(), array_set_element_expanded(), array_set_isnull(), ArrayCastAndSet(), ArrayCheckBounds(), ArrayGetNItems(), ArrayGetOffset(), att_addlength_datum, att_addlength_pointer, att_align_nominal, construct_md_array(), ArrayType::dataoffset, DatumGetArrayTypeP, DatumGetPointer(), ArrayType::elemtype, ereport, errcode(), errmsg(), ERROR, i, MaxArraySize, MAXDIM, ArrayType::ndim, palloc(), palloc0(), pg_add_s32_overflow(), PG_DETOAST_DATUM, pg_sub_s32_overflow(), PointerGetDatum(), SET_VARSIZE, and VARATT_IS_EXTERNAL_EXPANDED.
Referenced by array_append(), array_prepend(), array_set(), and array_subscript_assign().
Datum array_set_slice | ( | Datum | arraydatum, |
int | nSubscripts, | ||
int * | upperIndx, | ||
int * | lowerIndx, | ||
bool * | upperProvided, | ||
bool * | lowerProvided, | ||
Datum | srcArrayDatum, | ||
bool | isNull, | ||
int | arraytyplen, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign | ||
) |
Definition at line 2806 of file arrayfuncs.c.
References ARR_DATA_OFFSET, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_LBOUND, ARR_NDIM, ARR_NULLBITMAP, ARR_OVERHEAD_NONULLS, ARR_OVERHEAD_WITHNULLS, ARR_SIZE, array_bitmap_copy(), array_insert_slice(), array_nelems_size(), array_slice_size(), ArrayCheckBounds(), ArrayGetNItems(), Assert, construct_md_array(), ArrayType::dataoffset, DatumGetArrayTypeP, deconstruct_array(), ArrayType::elemtype, ereport, errcode(), errdetail(), errmsg(), ERROR, i, Max, MaxArraySize, MAXDIM, mda_get_range(), Min, ArrayType::ndim, nitems, palloc0(), pg_add_s32_overflow(), pg_sub_s32_overflow(), PointerGetDatum(), and SET_VARSIZE.
Referenced by array_subscript_assign_slice().
void ArrayCheckBounds | ( | int | ndim, |
const int * | dims, | ||
const int * | lb | ||
) |
Definition at line 117 of file arrayutils.c.
References ArrayCheckBoundsSafe().
Referenced by array_cat(), array_fill_internal(), array_recv(), array_set_element(), array_set_element_expanded(), array_set_slice(), construct_md_array(), ExecEvalArrayExpr(), and makeArrayResultArr().
Definition at line 127 of file arrayutils.c.
References ereturn, errcode(), errmsg(), i, pg_add_s32_overflow(), and PG_USED_FOR_ASSERTS_ONLY.
Referenced by ArrayCheckBounds().
Definition at line 233 of file arrayutils.c.
References ARR_ELEMTYPE, ARR_NDIM, array_contains_nulls(), DatumGetCString(), deconstruct_array_builtin(), ereport, errcode(), errmsg(), ERROR, i, palloc(), pfree(), and pg_strtoint32().
Referenced by anybit_typmodin(), anychar_typmodin(), anytime_typmodin(), anytimestamp_typmodin(), intervaltypmodin(), and numerictypmodin().
int ArrayGetNItems | ( | int | ndim, |
const int * | dims | ||
) |
Definition at line 57 of file arrayutils.c.
References ArrayGetNItemsSafe().
Referenced by _arrq_cons(), _lca(), _lt_q_regex(), _ltree_compress(), accumArrayResultArr(), array_cardinality(), array_cat(), array_cmp(), array_contain_compare(), array_contains_nulls(), array_create_iterator(), array_eq(), array_fill_internal(), array_get_slice(), array_insert_slice(), array_iterator(), array_map(), array_out(), array_recv(), array_replace_internal(), array_send(), array_set_element(), array_set_element_expanded(), array_set_slice(), array_slice_size(), array_to_json_internal(), array_to_jsonb_internal(), array_to_text_internal(), array_unnest(), arrq_cons(), clause_is_strict_for(), construct_md_array(), convert_saop_to_hashed_saop_walker(), count_nulls(), deconstruct_array(), do_set_block_offsets(), EA_get_flat_size(), estimate_array_length(), ExecEvalArrayExpr(), ExecEvalHashedScalarArrayOp(), ExecEvalScalarArrayOp(), get_text_array_contents(), getWeights(), hash_array(), hash_array_extended(), is_strict_saop(), lt_q_regex(), makeArrayResultArr(), pg_isolation_test_session_is_blocked(), predicate_classify(), sanity_check_tid_array(), width_bucket_array_fixed(), width_bucket_array_float8(), and width_bucket_array_variable().
int ArrayGetNItemsSafe | ( | int | ndim, |
const int * | dims, | ||
struct Node * | escontext | ||
) |
Definition at line 67 of file arrayutils.c.
References Assert, ereturn, errcode(), errmsg(), i, and MaxArraySize.
Referenced by ArrayGetNItems().
int ArrayGetOffset | ( | int | n, |
const int * | dim, | ||
const int * | lb, | ||
const int * | indx | ||
) |
Definition at line 32 of file arrayutils.c.
Referenced by array_extract_slice(), array_get_element(), array_get_element_expanded(), array_insert_slice(), array_set_element(), array_set_element_expanded(), and array_slice_size().
ArrayType* construct_array | ( | Datum * | elems, |
int | nelems, | ||
Oid | elmtype, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign | ||
) |
Definition at line 3361 of file arrayfuncs.c.
References construct_md_array().
Referenced by ATExecAlterColumnType(), construct_array_builtin(), enum_range_internal(), match_orclause_to_indexcol(), serialize_expr_stats(), StoreAttrDefault(), and update_attstats().
Definition at line 3381 of file arrayfuncs.c.
References construct_array(), elog, ERROR, FLOAT8PASSBYVAL, and NAMEDATALEN.
Referenced by AlterPolicy(), attribute_statistics_update(), bt_page_print_tuples(), build_regtype_array(), convert_requires_to_datum(), CreateConstraintEntry(), CreateFunction(), CreatePolicy(), CreateStatistics(), current_schemas(), executeItemOptUnwrapTarget(), extension_config_remove(), filter_list_to_array(), float4_accum(), float8_accum(), float8_combine(), float8_regr_accum(), float8_regr_combine(), get_environ(), get_hba_options(), GetWALBlockInfo(), gin_leafpage_items(), gin_page_opaque_info(), gist_page_opaque_info(), GUCArrayAdd(), GUCArrayDelete(), GUCArrayReset(), hash_metapage_info(), heap_tuple_infomask_flags(), hstore_akeys(), int_list_to_array(), interpret_function_parameter_list(), makeMultirangeConstructors(), pg_blocking_pids(), pg_extension_config_dump(), pg_get_logical_snapshot_info(), pg_safe_snapshot_blocking_pids(), pg_settings_get_flags(), publicationListToArray(), RemoveRoleFromObjectPolicy(), serialize_expr_stats(), show_trgm(), test_rls_hooks_permissive(), test_rls_hooks_restrictive(), ts_lexize(), tsvector_to_array(), tsvector_unnest(), typenameTypeMod(), and update_attstats().
Definition at line 3580 of file arrayfuncs.c.
References ArrayType::dataoffset, ArrayType::elemtype, ArrayType::ndim, palloc0(), and SET_VARSIZE.
Referenced by array_fill_internal(), array_get_slice(), array_in(), array_map(), array_recv(), array_replace_internal(), array_shuffle_n(), array_subscript_assign(), array_subscript_assign_slice(), construct_empty_expanded_array(), construct_md_array(), ExecEvalArrayExpr(), heap_tuple_infomask_flags(), hstore_akeys(), hstore_avals(), hstore_slice_to_array(), hstore_to_array_internal(), makeArrayResultArr(), new_intArrayType(), percentile_cont_multi_final_common(), percentile_disc_multi_final(), pg_event_trigger_dropped_objects(), pg_identify_object_as_address(), plperl_array_to_datum(), PLySequence_ToArray(), resize_intArrayType(), text_to_array(), and transformGenericOptions().
ExpandedArrayHeader* construct_empty_expanded_array | ( | Oid | element_type, |
MemoryContext | parentcontext, | ||
ArrayMetaState * | metacache | ||
) |
Definition at line 3597 of file arrayfuncs.c.
References construct_empty_array(), DatumGetEOHP(), expand_array(), pfree(), and PointerGetDatum().
Referenced by fetch_array_arg_replace_nulls().
ArrayType* construct_md_array | ( | Datum * | elems, |
bool * | nulls, | ||
int | ndims, | ||
int * | dims, | ||
int * | lbs, | ||
Oid | elmtype, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign | ||
) |
Definition at line 3494 of file arrayfuncs.c.
References AllocSizeIsValid, ARR_DIMS, ARR_LBOUND, ARR_OVERHEAD_NONULLS, ARR_OVERHEAD_WITHNULLS, ArrayCheckBounds(), ArrayGetNItems(), att_addlength_datum, att_align_nominal, construct_empty_array(), CopyArrayEls(), ArrayType::dataoffset, ArrayType::elemtype, ereport, errcode(), errmsg(), ERROR, i, MaxAllocSize, MAXDIM, ArrayType::ndim, palloc0(), PG_DETOAST_DATUM, PointerGetDatum(), and SET_VARSIZE.
Referenced by array_iterate(), array_reverse_n(), array_set_element(), array_set_slice(), array_shuffle_n(), build_regexp_match_result(), build_test_info_result(), build_test_match_result(), construct_array(), ExecEvalArrayExpr(), hstore_avals(), hstore_slice_to_array(), hstore_to_array_internal(), makeMdArrayResult(), percentile_cont_multi_final_common(), percentile_disc_multi_final(), plpgsql_fulfill_promise(), and strlist_to_textarray().
void CopyArrayEls | ( | ArrayType * | array, |
Datum * | values, | ||
bool * | nulls, | ||
int | nitems, | ||
int | typlen, | ||
bool | typbyval, | ||
char | typalign, | ||
bool | freedata | ||
) |
Definition at line 961 of file arrayfuncs.c.
References ARR_DATA_PTR, ARR_NULLBITMAP, ArrayCastAndSet(), DatumGetPointer(), elog, ERROR, i, nitems, pfree(), typalign, and values.
Referenced by array_in(), array_map(), array_recv(), array_replace_internal(), construct_md_array(), and EA_flatten_into().
AnyArrayType* DatumGetAnyArrayP | ( | Datum | d | ) |
Definition at line 401 of file array_expanded.c.
References Assert, DatumGetEOHP(), DatumGetPointer(), EA_MAGIC, ExpandedArrayHeader::ea_magic, PG_DETOAST_DATUM, and VARATT_IS_EXTERNAL_EXPANDED.
Referenced by array_map().
ExpandedArrayHeader* DatumGetExpandedArray | ( | Datum | d | ) |
Definition at line 352 of file array_expanded.c.
References Assert, CurrentMemoryContext, DatumGetEOHP(), DatumGetPointer(), EA_MAGIC, ExpandedArrayHeader::ea_magic, expand_array(), and VARATT_IS_EXTERNAL_EXPANDED_RW.
Referenced by array_set_element_expanded(), and statext_expressions_load().
ExpandedArrayHeader* DatumGetExpandedArrayX | ( | Datum | d, |
ArrayMetaState * | metacache | ||
) |
Definition at line 372 of file array_expanded.c.
References Assert, CurrentMemoryContext, DatumGetEOHP(), DatumGetPointer(), EA_MAGIC, ExpandedArrayHeader::ea_magic, ExpandedArrayHeader::element_type, ArrayMetaState::element_type, expand_array(), ExpandedArrayHeader::typalign, ArrayMetaState::typalign, ExpandedArrayHeader::typbyval, ArrayMetaState::typbyval, ExpandedArrayHeader::typlen, ArrayMetaState::typlen, and VARATT_IS_EXTERNAL_EXPANDED_RW.
void deconstruct_array | ( | ArrayType * | array, |
Oid | elmtype, | ||
int | elmlen, | ||
bool | elmbyval, | ||
char | elmalign, | ||
Datum ** | elemsp, | ||
bool ** | nullsp, | ||
int * | nelemsp | ||
) |
Definition at line 3631 of file arrayfuncs.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_NDIM, ARR_NULLBITMAP, ArrayGetNItems(), Assert, att_addlength_pointer, att_align_nominal, ereport, errcode(), errmsg(), ERROR, fetch_att(), i, palloc(), and palloc0().
Referenced by _bt_preprocess_array_keys(), array_contain_compare(), array_reverse_n(), array_set_slice(), array_shuffle_n(), array_to_json_internal(), array_to_jsonb_internal(), arrayconst_startup_fn(), compute_array_stats(), deconstruct_array_builtin(), deconstruct_expanded_array(), ExecIndexEvalArrayKeys(), extract_variadic_args(), get_attstatsslot(), ginarrayextract(), gincost_scalararrayopexpr(), ginqueryarrayextract(), map_sql_value_to_xml_value(), match_clause_to_partition_key(), mcelem_array_selec(), mcv_get_match_bitmap(), multirange_constructor2(), plperl_ref_from_pg_array(), satisfies_hash_partition(), scalararraysel(), and text_format().
void deconstruct_array_builtin | ( | ArrayType * | array, |
Oid | elmtype, | ||
Datum ** | elemsp, | ||
bool ** | nullsp, | ||
int * | nelemsp | ||
) |
Definition at line 3697 of file arrayfuncs.c.
References deconstruct_array(), elog, ERROR, and FLOAT8PASSBYVAL.
Referenced by array_to_tsvector(), ArrayGetIntegerTypmods(), binary_upgrade_create_empty_extension(), build_function_result_tupdesc_d(), DecodeTextArrayToBitmapset(), decompile_column_index_array(), extension_config_remove(), generateClonedIndexStmt(), get_func_arg_info(), get_func_input_arg_names(), get_func_result_name(), get_jsonb_path_all(), get_path_all(), get_reloptions(), ghstore_consistent(), gin_extract_hstore_query(), gin_extract_jsonb_query(), hstore_from_array(), hstore_from_arrays(), hstore_slice_to_array(), hstoreArrayToPairs(), json_object(), json_object_two_arg(), jsonb_delete_array(), jsonb_delete_path(), jsonb_exists_all(), jsonb_exists_any(), jsonb_insert(), jsonb_object(), jsonb_object_two_arg(), jsonb_set(), oid_array_to_list(), parse_key_value_arrays(), parseRelOptionsInternal(), percentile_cont_multi_final_common(), percentile_disc_multi_final(), pg_get_constraintdef_worker(), pg_get_object_address(), pg_get_publication_tables(), pg_logical_slot_get_changes_guts(), textarray_to_stringlist(), textarray_to_strvaluelist(), TidListEval(), transformRelOptions(), tsvector_delete_arr(), tsvector_filter(), tsvector_setweight_by_filter(), untransformRelOptions(), and worker_spi_launch().
void deconstruct_expanded_array | ( | ExpandedArrayHeader * | eah | ) |
Definition at line 424 of file array_expanded.c.
References ARR_HASNULL, deconstruct_array(), ExpandedArrayHeader::dnulls, ExpandedArrayHeader::dvalues, ExpandedArrayHeader::dvalueslen, ExpandedArrayHeader::element_type, ExpandedObjectHeader::eoh_context, ExpandedArrayHeader::fvalue, ExpandedArrayHeader::hdr, MemoryContextSwitchTo(), ExpandedArrayHeader::nelems, ExpandedArrayHeader::typalign, ExpandedArrayHeader::typbyval, and ExpandedArrayHeader::typlen.
Referenced by array_contain_compare(), array_get_element_expanded(), array_set_element_expanded(), and statext_expressions_load().
Datum expand_array | ( | Datum | arraydatum, |
MemoryContext | parentcontext, | ||
ArrayMetaState * | metacache | ||
) |
Definition at line 50 of file array_expanded.c.
References ALLOCSET_START_SMALL_SIZES, AllocSetContextCreate, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, ARR_SIZE, Assert, copy_byval_expanded_array(), DatumGetArrayTypePCopy, DatumGetEOHP(), DatumGetPointer(), ExpandedArrayHeader::dims, ExpandedArrayHeader::dnulls, ExpandedArrayHeader::dvalues, ExpandedArrayHeader::dvalueslen, EA_MAGIC, ExpandedArrayHeader::ea_magic, EA_methods, ExpandedArrayHeader::element_type, ArrayMetaState::element_type, EOH_init_header(), EOHPGetRWDatum(), ExpandedArrayHeader::fendptr, ExpandedArrayHeader::flat_size, ExpandedArrayHeader::fstartptr, ExpandedArrayHeader::fvalue, get_typlenbyvalalign(), ExpandedArrayHeader::hdr, ExpandedArrayHeader::lbound, MemoryContextAlloc(), MemoryContextSwitchTo(), ExpandedArrayHeader::ndims, ExpandedArrayHeader::nelems, ExpandedArrayHeader::typalign, ArrayMetaState::typalign, ExpandedArrayHeader::typbyval, ArrayMetaState::typbyval, ExpandedArrayHeader::typlen, ArrayMetaState::typlen, and VARATT_IS_EXTERNAL_EXPANDED.
Referenced by construct_empty_expanded_array(), DatumGetExpandedArray(), DatumGetExpandedArrayX(), exec_assign_value(), and plpgsql_exec_function().
ArrayBuildState* initArrayResult | ( | Oid | element_type, |
MemoryContext | rcontext, | ||
bool | subcontext | ||
) |
Definition at line 5293 of file arrayfuncs.c.
References initArrayResultWithSize().
Referenced by accumArrayResult(), array_agg_transfn(), array_positions(), array_to_datum_internal(), daitch_mokotoff(), initArrayResultAny(), multirange_agg_transfn(), PLySequence_ToArray_recurse(), populate_array(), range_agg_transfn(), tuple_data_split_internal(), and xpath().
ArrayBuildStateAny* initArrayResultAny | ( | Oid | input_type, |
MemoryContext | rcontext, | ||
bool | subcontext | ||
) |
Definition at line 5782 of file arrayfuncs.c.
References ArrayBuildStateAny::arraystate, Assert, get_array_type(), get_element_type(), initArrayResult(), initArrayResultArr(), InvalidOid, ArrayBuildState::mcontext, ArrayBuildStateArr::mcontext, MemoryContextAlloc(), OidIsValid, and ArrayBuildStateAny::scalarstate.
Referenced by accumArrayResultAny(), ExecScanSubPlan(), and ExecSetParamPlan().
ArrayBuildStateArr* initArrayResultArr | ( | Oid | array_type, |
Oid | element_type, | ||
MemoryContext | rcontext, | ||
bool | subcontext | ||
) |
Definition at line 5504 of file arrayfuncs.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, ArrayBuildStateArr::array_type, ArrayBuildStateArr::element_type, ereport, errcode(), errmsg(), ERROR, format_type_be(), get_element_type(), ArrayBuildStateArr::mcontext, MemoryContextAllocZero(), OidIsValid, and ArrayBuildStateArr::private_cxt.
Referenced by accumArrayResultArr(), array_agg_array_combine(), array_agg_array_deserialize(), array_agg_array_transfn(), and initArrayResultAny().
ArrayBuildState* initArrayResultWithSize | ( | Oid | element_type, |
MemoryContext | rcontext, | ||
bool | subcontext, | ||
int | initsize | ||
) |
Definition at line 5310 of file arrayfuncs.c.
References ArrayBuildState::alen, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, ArrayBuildState::dnulls, ArrayBuildState::dvalues, ArrayBuildState::element_type, get_typlenbyvalalign(), ArrayBuildState::mcontext, MemoryContextAlloc(), ArrayBuildState::nelems, ArrayBuildState::private_cxt, ArrayBuildState::typalign, ArrayBuildState::typbyval, and ArrayBuildState::typlen.
Referenced by array_agg_combine(), array_agg_deserialize(), and initArrayResult().
Datum makeArrayResult | ( | ArrayBuildState * | astate, |
MemoryContext | rcontext | ||
) |
Definition at line 5420 of file arrayfuncs.c.
References makeMdArrayResult(), ArrayBuildState::nelems, and ArrayBuildState::private_cxt.
Referenced by array_positions(), brin_minmax_multi_summary_out(), daitch_mokotoff(), dblink_get_connections(), optionListToArray(), parse_ident(), pg_get_statisticsobjdef_expressions(), pg_stats_ext_mcvlist_items(), regexp_split_to_array(), serialize_expr_stats(), text_to_array(), transformRelOptions(), tuple_data_split_internal(), and xpath().
Datum makeArrayResultAny | ( | ArrayBuildStateAny * | astate, |
MemoryContext | rcontext, | ||
bool | release | ||
) |
Definition at line 5855 of file arrayfuncs.c.
References ArrayBuildStateAny::arraystate, makeArrayResultArr(), makeMdArrayResult(), ArrayBuildState::nelems, and ArrayBuildStateAny::scalarstate.
Referenced by ExecScanSubPlan(), and ExecSetParamPlan().
Datum makeArrayResultArr | ( | ArrayBuildStateArr * | astate, |
MemoryContext | rcontext, | ||
bool | release | ||
) |
Definition at line 5703 of file arrayfuncs.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_LBOUND, ARR_NULLBITMAP, ARR_OVERHEAD_NONULLS, ARR_OVERHEAD_WITHNULLS, array_bitmap_copy(), ArrayCheckBounds(), ArrayGetNItems(), Assert, construct_empty_array(), ArrayBuildStateArr::data, ArrayType::dataoffset, ArrayBuildStateArr::dims, ArrayBuildStateArr::element_type, ArrayType::elemtype, ArrayBuildStateArr::lbs, ArrayBuildStateArr::mcontext, MemoryContextDelete(), MemoryContextSwitchTo(), ArrayBuildStateArr::nbytes, ArrayType::ndim, ArrayBuildStateArr::ndims, ArrayBuildStateArr::nitems, ArrayBuildStateArr::nullbitmap, palloc0(), PointerGetDatum(), ArrayBuildStateArr::private_cxt, and SET_VARSIZE.
Referenced by array_agg_array_finalfn(), and makeArrayResultAny().
Datum makeMdArrayResult | ( | ArrayBuildState * | astate, |
int | ndims, | ||
int * | dims, | ||
int * | lbs, | ||
MemoryContext | rcontext, | ||
bool | release | ||
) |
Definition at line 5452 of file arrayfuncs.c.
References Assert, construct_md_array(), ArrayBuildState::dnulls, ArrayBuildState::dvalues, ArrayBuildState::element_type, ArrayBuildState::mcontext, MemoryContextDelete(), MemoryContextSwitchTo(), PointerGetDatum(), ArrayBuildState::private_cxt, ArrayBuildState::typalign, ArrayBuildState::typbyval, and ArrayBuildState::typlen.
Referenced by array_agg_finalfn(), makeArrayResult(), makeArrayResultAny(), plperl_array_to_datum(), PLySequence_ToArray(), and populate_array().
void mda_get_offset_values | ( | int | n, |
int * | dist, | ||
const int * | prod, | ||
const int * | span | ||
) |
Definition at line 183 of file arrayutils.c.
Referenced by array_extract_slice(), array_insert_slice(), and array_slice_size().
void mda_get_prod | ( | int | n, |
const int * | range, | ||
int * | prod | ||
) |
Definition at line 167 of file arrayutils.c.
Referenced by array_extract_slice(), array_insert_slice(), and array_slice_size().
void mda_get_range | ( | int | n, |
int * | span, | ||
const int * | st, | ||
const int * | endp | ||
) |
Definition at line 153 of file arrayutils.c.
References i.
Referenced by array_extract_slice(), array_get_slice(), array_insert_slice(), array_set_slice(), and array_slice_size().
int mda_next_tuple | ( | int | n, |
int * | curr, | ||
const int * | span | ||
) |
Definition at line 208 of file arrayutils.c.
References i.
Referenced by array_extract_slice(), array_insert_slice(), and array_slice_size().
|
extern |
Definition at line 43 of file arrayfuncs.c.
Referenced by ReadArrayToken().