PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_type.h"
#include "common/hashfn.h"
#include "funcapi.h"
#include "hstore.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
Go to the source code of this file.
Datum hstore_akeys | ( | PG_FUNCTION_ARGS | ) |
Definition at line 692 of file hstore_op.c.
References a, ARRPTR, construct_array_builtin(), construct_empty_array(), cstring_to_text_with_len(), HS_COUNT, HSTORE_KEY, HSTORE_KEYLEN, i, palloc(), PG_GETARG_HSTORE_P, PG_RETURN_POINTER, PointerGetDatum(), and STRPTR.
Datum hstore_avals | ( | PG_FUNCTION_ARGS | ) |
Definition at line 726 of file hstore_op.c.
References a, ARRPTR, construct_empty_array(), construct_md_array(), cstring_to_text_with_len(), HS_COUNT, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, palloc(), PG_GETARG_HSTORE_P, PG_RETURN_POINTER, PointerGetDatum(), and STRPTR.
Datum hstore_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1082 of file hstore_op.c.
References ARRPTR, HS_COUNT, HSE_ENDPOS, HSE_ISNULL, i, Min, PG_FREE_IF_COPY, PG_GETARG_HSTORE_P, PG_RETURN_INT32, res, and STRPTR.
Referenced by hstore_eq(), hstore_ge(), hstore_gt(), hstore_le(), hstore_lt(), and hstore_ne().
Datum hstore_concat | ( | PG_FUNCTION_ARGS | ) |
Definition at line 471 of file hstore_op.c.
References ARRPTR, difference(), HS_COPYITEM, HS_COUNT, HS_FINALIZE, HS_FIXSIZE, HS_SETCOUNT, HSHRDSIZE, HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VALISNULL, HSTORE_VALLEN, palloc(), PG_GETARG_HSTORE_P, PG_RETURN_POINTER, s1, s2, SET_VARSIZE, STRPTR, and VARSIZE.
Datum hstore_contained | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1010 of file hstore_op.c.
References DirectFunctionCall2, hstore_contains(), PG_GETARG_DATUM, and PG_RETURN_DATUM.
Datum hstore_contains | ( | PG_FUNCTION_ARGS | ) |
Definition at line 962 of file hstore_op.c.
References ARRPTR, HS_COUNT, HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreFindKey(), i, idx(), PG_GETARG_HSTORE_P, PG_RETURN_BOOL, res, STRPTR, and val.
Referenced by hstore_contained().
Datum hstore_defined | ( | PG_FUNCTION_ARGS | ) |
Definition at line 230 of file hstore_op.c.
References ARRPTR, HSTORE_VALISNULL, hstoreFindKey(), idx(), sort-test::key, PG_GETARG_HSTORE_P, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, res, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum hstore_delete | ( | PG_FUNCTION_ARGS | ) |
Definition at line 245 of file hstore_op.c.
References ARRPTR, HS_COPYITEM, HS_COUNT, HS_FINALIZE, HS_SETCOUNT, HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VALISNULL, HSTORE_VALLEN, i, sort-test::key, len, palloc(), PG_GETARG_HSTORE_P, PG_GETARG_TEXT_PP, PG_RETURN_POINTER, SET_VARSIZE, STRPTR, VARDATA_ANY, VARSIZE, and VARSIZE_ANY_EXHDR.
Datum hstore_delete_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 292 of file hstore_op.c.
References ARRPTR, difference(), HS_COPYITEM, HS_COUNT, HS_FINALIZE, HS_FIXSIZE, HS_SETCOUNT, HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreArrayToPairs(), i, j, sort-test::key, Pairs::keylen, palloc(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, PG_RETURN_POINTER, ps, SET_VARSIZE, STRPTR, and VARSIZE.
Datum hstore_delete_hstore | ( | PG_FUNCTION_ARGS | ) |
Definition at line 371 of file hstore_op.c.
References ARRPTR, difference(), HS_COPYITEM, HS_COUNT, HS_FINALIZE, HS_FIXSIZE, HS_SETCOUNT, HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, j, palloc(), PG_GETARG_HSTORE_P, PG_RETURN_POINTER, ps, SET_VARSIZE, STRPTR, and VARSIZE.
Datum hstore_each | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1021 of file hstore_op.c.
References ARRPTR, FuncCallContext::call_cntr, cstring_to_text_with_len(), heap_form_tuple(), HeapTupleGetDatum(), HS_COUNT, HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, if(), PG_GETARG_HSTORE_P, PointerGetDatum(), res, setup_firstcall(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, STRPTR, FuncCallContext::tuple_desc, and FuncCallContext::user_fctx.
Datum hstore_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1163 of file hstore_op.c.
References DatumGetInt32(), DirectFunctionCall2, hstore_cmp(), PG_GETARG_DATUM, PG_RETURN_BOOL, and res.
Datum hstore_exists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 149 of file hstore_op.c.
References hstoreFindKey(), idx(), sort-test::key, PG_GETARG_HSTORE_P, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum hstore_exists_all | ( | PG_FUNCTION_ARGS | ) |
Definition at line 196 of file hstore_op.c.
References hstoreArrayToPairs(), hstoreFindKey(), i, idx(), sort-test::key, PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, PG_RETURN_BOOL, and res.
Datum hstore_exists_any | ( | PG_FUNCTION_ARGS | ) |
Definition at line 162 of file hstore_op.c.
References hstoreArrayToPairs(), hstoreFindKey(), i, idx(), sort-test::key, PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, PG_RETURN_BOOL, and res.
Datum hstore_fetchval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 128 of file hstore_op.c.
References ARRPTR, cstring_to_text_with_len(), HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreFindKey(), idx(), sort-test::key, PG_GETARG_HSTORE_P, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, STRPTR, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum hstore_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1196 of file hstore_op.c.
References DatumGetInt32(), DirectFunctionCall2, hstore_cmp(), PG_GETARG_DATUM, PG_RETURN_BOOL, and res.
Datum hstore_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1185 of file hstore_op.c.
References DatumGetInt32(), DirectFunctionCall2, hstore_cmp(), PG_GETARG_DATUM, PG_RETURN_BOOL, and res.
Datum hstore_hash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1230 of file hstore_op.c.
References ARRPTR, Assert, CALCDATASIZE, hash_any(), HS_COUNT, HSE_ENDPOS, HSHRDSIZE, PG_FREE_IF_COPY, PG_GETARG_HSTORE_P, PG_RETURN_DATUM, VARDATA, VARHDRSZ, and VARSIZE.
Datum hstore_hash_extended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1254 of file hstore_op.c.
References ARRPTR, Assert, CALCDATASIZE, hash_any_extended(), HS_COUNT, HSE_ENDPOS, HSHRDSIZE, PG_FREE_IF_COPY, PG_GETARG_HSTORE_P, PG_GETARG_INT64, PG_RETURN_DATUM, VARDATA, VARHDRSZ, and VARSIZE.
Datum hstore_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1218 of file hstore_op.c.
References DatumGetInt32(), DirectFunctionCall2, hstore_cmp(), PG_GETARG_DATUM, PG_RETURN_BOOL, and res.
Datum hstore_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1207 of file hstore_op.c.
References DatumGetInt32(), DirectFunctionCall2, hstore_cmp(), PG_GETARG_DATUM, PG_RETURN_BOOL, and res.
Datum hstore_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1174 of file hstore_op.c.
References DatumGetInt32(), DirectFunctionCall2, hstore_cmp(), PG_GETARG_DATUM, PG_RETURN_BOOL, and res.
HSTORE_POLLUTE | ( | hstore_akeys | , |
akeys | |||
) |
HSTORE_POLLUTE | ( | hstore_avals | , |
avals | |||
) |
HSTORE_POLLUTE | ( | hstore_concat | , |
hs_concat | |||
) |
HSTORE_POLLUTE | ( | hstore_contained | , |
hs_contained | |||
) |
HSTORE_POLLUTE | ( | hstore_contains | , |
hs_contains | |||
) |
HSTORE_POLLUTE | ( | hstore_defined | , |
defined | |||
) |
HSTORE_POLLUTE | ( | hstore_delete | , |
delete | |||
) |
HSTORE_POLLUTE | ( | hstore_each | , |
each | |||
) |
HSTORE_POLLUTE | ( | hstore_exists | , |
exists | |||
) |
HSTORE_POLLUTE | ( | hstore_fetchval | , |
fetchval | |||
) |
HSTORE_POLLUTE | ( | hstore_skeys | , |
skeys | |||
) |
HSTORE_POLLUTE | ( | hstore_svals | , |
svals | |||
) |
Datum hstore_skeys | ( | PG_FUNCTION_ARGS | ) |
Definition at line 880 of file hstore_op.c.
References ARRPTR, FuncCallContext::call_cntr, cstring_to_text_with_len(), HS_COUNT, HSTORE_KEY, HSTORE_KEYLEN, i, if(), PG_GETARG_HSTORE_P, PointerGetDatum(), setup_firstcall(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, STRPTR, and FuncCallContext::user_fctx.
Datum hstore_slice_to_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 569 of file hstore_op.c.
References ARR_DIMS, ARR_LBOUND, ARR_NDIM, ARRPTR, construct_empty_array(), construct_md_array(), cstring_to_text_with_len(), DatumGetPointer(), deconstruct_array_builtin(), HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreFindKey(), i, idx(), sort-test::key, palloc(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, PG_RETURN_POINTER, PointerGetDatum(), STRPTR, VARDATA, VARHDRSZ, and VARSIZE.
Datum hstore_slice_to_hstore | ( | PG_FUNCTION_ARGS | ) |
Definition at line 630 of file hstore_op.c.
References ARRPTR, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreArrayToPairs(), hstoreFindKey(), hstorePairs, i, idx(), Pairs::isnull, Pairs::key, sort-test::key, Pairs::keylen, Pairs::needfree, palloc(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, PG_RETURN_POINTER, STRPTR, Pairs::val, and Pairs::vallen.
Datum hstore_svals | ( | PG_FUNCTION_ARGS | ) |
Definition at line 914 of file hstore_op.c.
References ARRPTR, FuncCallContext::call_cntr, cstring_to_text_with_len(), ExprMultipleResult, HS_COUNT, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, if(), ReturnSetInfo::isDone, PG_GETARG_HSTORE_P, PG_RETURN_NULL, PointerGetDatum(), setup_firstcall(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, STRPTR, and FuncCallContext::user_fctx.
Datum hstore_to_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 822 of file hstore_op.c.
References hstore_to_array_internal(), PG_GETARG_HSTORE_P, and PG_RETURN_POINTER.
Definition at line 772 of file hstore_op.c.
References ARRPTR, Assert, construct_empty_array(), construct_md_array(), cstring_to_text_with_len(), HS_COUNT, HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, sort-test::key, palloc(), PointerGetDatum(), and STRPTR.
Referenced by hstore_to_array(), and hstore_to_matrix().
Datum hstore_to_matrix | ( | PG_FUNCTION_ARGS | ) |
Definition at line 832 of file hstore_op.c.
References hstore_to_array_internal(), PG_GETARG_HSTORE_P, and PG_RETURN_POINTER.
Definition at line 73 of file hstore_op.c.
References a, deconstruct_array_builtin(), ereport, errcode(), errmsg(), ERROR, hstoreUniquePairs, i, Pairs::isnull, j, Pairs::key, Pairs::keylen, MaxAllocSize, Pairs::needfree, palloc(), Pairs::val, Pairs::vallen, VARDATA, VARHDRSZ, and VARSIZE.
Referenced by hstore_delete_array(), hstore_exists_all(), hstore_exists_any(), and hstore_slice_to_hstore().
int hstoreFindKey | ( | HStore * | hs, |
int * | lowbound, | ||
char * | key, | ||
int | keylen | ||
) |
Definition at line 36 of file hstore_op.c.
References ARRPTR, difference(), HS_COUNT, HSTORE_KEY, HSTORE_KEYLEN, sort-test::key, and STRPTR.
Referenced by hstore_contains(), hstore_defined(), hstore_exists(), hstore_exists_all(), hstore_exists_any(), hstore_fetchval(), hstore_populate_record(), hstore_slice_to_array(), hstore_slice_to_hstore(), and hstore_subscript_fetch().
PG_FUNCTION_INFO_V1 | ( | hstore_akeys | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_avals | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_cmp | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_concat | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_contained | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_contains | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_defined | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_delete | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_delete_array | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_delete_hstore | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_each | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_eq | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_exists | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_exists_all | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_exists_any | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_fetchval | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_ge | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_gt | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_hash | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_hash_extended | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_le | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_lt | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_ne | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_skeys | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_slice_to_array | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_slice_to_hstore | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_svals | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_to_array | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_to_matrix | ) |
|
static |
Definition at line 850 of file hstore_op.c.
References BlessTupleDesc(), elog, ERROR, get_call_result_type(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, palloc(), FuncCallContext::tuple_desc, TYPEFUNC_COMPOSITE, FuncCallContext::user_fctx, and VARSIZE.
Referenced by hstore_each(), hstore_skeys(), and hstore_svals().