PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "hstore.h"
#include "utils/builtins.h"
#include "utils/hashutils.h"
#include "utils/memutils.h"
Go to the source code of this file.
Datum hstore_akeys | ( | PG_FUNCTION_ARGS | ) |
Definition at line 696 of file hstore_op.c.
References ARRPTR, construct_array(), construct_empty_array(), cstring_to_text_with_len(), HS_COUNT, hstore_avals(), HSTORE_KEY, HSTORE_KEYLEN, i, palloc(), PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_RETURN_POINTER, PointerGetDatum, and STRPTR.
Referenced by hstore_slice_to_hstore().
Datum hstore_avals | ( | PG_FUNCTION_ARGS | ) |
Definition at line 731 of file hstore_op.c.
References 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.
Referenced by hstore_akeys().
Datum hstore_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1087 of file hstore_op.c.
References ARRPTR, HS_COUNT, HSE_ENDPOS, HSE_ISNULL, hstore_eq(), i, Min, PG_FREE_IF_COPY, PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_RETURN_INT32, and STRPTR.
Referenced by hstore_each(), hstore_eq(), hstore_ge(), hstore_gt(), hstore_le(), hstore_lt(), and hstore_ne().
Datum hstore_concat | ( | PG_FUNCTION_ARGS | ) |
Definition at line 473 of file hstore_op.c.
References ARRPTR, difference(), HS_COPYITEM, HS_COUNT, HS_FINALIZE, HS_FIXSIZE, HS_SETCOUNT, HSHRDSIZE, HSTORE_KEY, HSTORE_KEYLEN, hstore_slice_to_array(), HSTORE_VALISNULL, HSTORE_VALLEN, palloc(), PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_RETURN_POINTER, s1, s2, SET_VARSIZE, STRPTR, and VARSIZE.
Referenced by hstore_delete_hstore().
Datum hstore_contained | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1015 of file hstore_op.c.
References DirectFunctionCall2, hstore_contains(), hstore_each(), PG_FUNCTION_INFO_V1(), PG_GETARG_DATUM, and PG_RETURN_DATUM.
Referenced by hstore_contains().
Datum hstore_contains | ( | PG_FUNCTION_ARGS | ) |
Definition at line 967 of file hstore_op.c.
References ARRPTR, HS_COUNT, hstore_contained(), HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreFindKey(), i, idx(), PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_RETURN_BOOL, STRPTR, and val.
Referenced by hstore_contained(), and hstore_svals().
Datum hstore_defined | ( | PG_FUNCTION_ARGS | ) |
Definition at line 232 of file hstore_op.c.
References ARRPTR, hstore_delete(), HSTORE_VALISNULL, hstoreFindKey(), idx(), sort-test::key, PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by hstore_exists_all().
Datum hstore_delete | ( | PG_FUNCTION_ARGS | ) |
Definition at line 247 of file hstore_op.c.
References ARRPTR, HS_COPYITEM, HS_COUNT, HS_FINALIZE, HS_SETCOUNT, hstore_delete_array(), HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VALISNULL, HSTORE_VALLEN, i, sort-test::key, palloc(), PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_GETARG_TEXT_PP, PG_RETURN_POINTER, SET_VARSIZE, STRPTR, VARDATA_ANY, VARSIZE, and VARSIZE_ANY_EXHDR.
Referenced by hstore_defined().
Datum hstore_delete_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 294 of file hstore_op.c.
References ARRPTR, difference(), HS_COPYITEM, HS_COUNT, HS_FINALIZE, HS_FIXSIZE, HS_SETCOUNT, hstore_delete_hstore(), HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreArrayToPairs(), i, sort-test::key, Pairs::keylen, palloc(), PG_FUNCTION_INFO_V1(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, PG_RETURN_POINTER, SET_VARSIZE, STRPTR, and VARSIZE.
Referenced by hstore_delete().
Datum hstore_delete_hstore | ( | PG_FUNCTION_ARGS | ) |
Definition at line 373 of file hstore_op.c.
References ARRPTR, difference(), HS_COPYITEM, HS_COUNT, HS_FINALIZE, HS_FIXSIZE, HS_SETCOUNT, hstore_concat(), HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, palloc(), PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_RETURN_POINTER, SET_VARSIZE, STRPTR, and VARSIZE.
Referenced by hstore_delete_array().
Datum hstore_each | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1026 of file hstore_op.c.
References ARRPTR, FuncCallContext::call_cntr, cstring_to_text_with_len(), heap_form_tuple(), HeapTupleGetDatum, HS_COUNT, hstore_cmp(), HSTORE_KEY, HSTORE_KEYLEN, HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PointerGetDatum, 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.
Referenced by hstore_contained().
Datum hstore_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1168 of file hstore_op.c.
References DatumGetInt32, DirectFunctionCall2, hstore_cmp(), hstore_ne(), PG_FUNCTION_INFO_V1(), PG_GETARG_DATUM, and PG_RETURN_BOOL.
Referenced by hstore_cmp().
Datum hstore_exists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 151 of file hstore_op.c.
References hstore_exists_any(), hstoreFindKey(), idx(), sort-test::key, PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by hstore_fetchval().
Datum hstore_exists_all | ( | PG_FUNCTION_ARGS | ) |
Definition at line 198 of file hstore_op.c.
References hstore_defined(), hstoreArrayToPairs(), hstoreFindKey(), i, idx(), sort-test::key, PG_FUNCTION_INFO_V1(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, and PG_RETURN_BOOL.
Referenced by hstore_exists_any().
Datum hstore_exists_any | ( | PG_FUNCTION_ARGS | ) |
Definition at line 164 of file hstore_op.c.
References hstore_exists_all(), hstoreArrayToPairs(), hstoreFindKey(), i, idx(), sort-test::key, PG_FUNCTION_INFO_V1(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, and PG_RETURN_BOOL.
Referenced by hstore_exists().
Datum hstore_fetchval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 130 of file hstore_op.c.
References ARRPTR, cstring_to_text_with_len(), hstore_exists(), HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreFindKey(), idx(), sort-test::key, PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, STRPTR, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by hstoreArrayToPairs().
Datum hstore_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1201 of file hstore_op.c.
References DatumGetInt32, DirectFunctionCall2, hstore_cmp(), hstore_lt(), PG_FUNCTION_INFO_V1(), PG_GETARG_DATUM, and PG_RETURN_BOOL.
Referenced by hstore_gt().
Datum hstore_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1190 of file hstore_op.c.
References DatumGetInt32, DirectFunctionCall2, hstore_cmp(), hstore_ge(), PG_FUNCTION_INFO_V1(), PG_GETARG_DATUM, and PG_RETURN_BOOL.
Referenced by hstore_ne().
Datum hstore_hash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1235 of file hstore_op.c.
References ARRPTR, Assert, CALCDATASIZE, hash_any(), HS_COUNT, HSE_ENDPOS, HSHRDSIZE, hstore_hash_extended(), PG_FREE_IF_COPY, PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, PG_RETURN_DATUM, VARDATA, VARHDRSZ, and VARSIZE.
Referenced by hstore_le().
Datum hstore_hash_extended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1259 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.
Referenced by hstore_hash().
Datum hstore_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1223 of file hstore_op.c.
References DatumGetInt32, DirectFunctionCall2, hstore_cmp(), hstore_hash(), PG_FUNCTION_INFO_V1(), PG_GETARG_DATUM, and PG_RETURN_BOOL.
Referenced by hstore_lt().
Datum hstore_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1212 of file hstore_op.c.
References DatumGetInt32, DirectFunctionCall2, hstore_cmp(), hstore_le(), PG_FUNCTION_INFO_V1(), PG_GETARG_DATUM, and PG_RETURN_BOOL.
Referenced by hstore_ge().
Datum hstore_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1179 of file hstore_op.c.
References DatumGetInt32, DirectFunctionCall2, hstore_cmp(), hstore_gt(), PG_FUNCTION_INFO_V1(), PG_GETARG_DATUM, and PG_RETURN_BOOL.
Referenced by hstore_eq().
HSTORE_POLLUTE | ( | hstore_fetchval | , |
fetchval | |||
) |
HSTORE_POLLUTE | ( | hstore_exists | , |
exists | |||
) |
HSTORE_POLLUTE | ( | hstore_defined | , |
defined | |||
) |
HSTORE_POLLUTE | ( | hstore_delete | , |
delete | |||
) |
HSTORE_POLLUTE | ( | hstore_concat | , |
hs_concat | |||
) |
HSTORE_POLLUTE | ( | hstore_contains | , |
hs_contains | |||
) |
HSTORE_POLLUTE | ( | hstore_contained | , |
hs_contained | |||
) |
HSTORE_POLLUTE | ( | hstore_akeys | , |
akeys | |||
) |
HSTORE_POLLUTE | ( | hstore_avals | , |
avals | |||
) |
HSTORE_POLLUTE | ( | hstore_skeys | , |
skeys | |||
) |
HSTORE_POLLUTE | ( | hstore_svals | , |
svals | |||
) |
HSTORE_POLLUTE | ( | hstore_each | , |
each | |||
) |
Datum hstore_skeys | ( | PG_FUNCTION_ARGS | ) |
Definition at line 885 of file hstore_op.c.
References ARRPTR, FuncCallContext::call_cntr, cstring_to_text_with_len(), HS_COUNT, HSTORE_KEY, HSTORE_KEYLEN, hstore_svals(), i, PG_FUNCTION_INFO_V1(), 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.
Referenced by setup_firstcall().
Datum hstore_slice_to_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 571 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(), hstore_slice_to_hstore(), HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreFindKey(), i, idx(), sort-test::key, palloc(), PG_FUNCTION_INFO_V1(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, PG_RETURN_POINTER, PointerGetDatum, STRPTR, VARDATA, VARHDRSZ, and VARSIZE.
Referenced by hstore_concat().
Datum hstore_slice_to_hstore | ( | PG_FUNCTION_ARGS | ) |
Definition at line 634 of file hstore_op.c.
References ARRPTR, hstore_akeys(), HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, hstoreArrayToPairs(), hstoreFindKey(), hstorePairs, i, idx(), Pairs::isnull, sort-test::key, Pairs::key, Pairs::keylen, Pairs::needfree, palloc(), PG_FUNCTION_INFO_V1(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_HSTORE_P, PG_RETURN_POINTER, STRPTR, Pairs::val, and Pairs::vallen.
Referenced by hstore_slice_to_array().
Datum hstore_svals | ( | PG_FUNCTION_ARGS | ) |
Definition at line 919 of file hstore_op.c.
References ARRPTR, FuncCallContext::call_cntr, cstring_to_text_with_len(), ExprMultipleResult, HS_COUNT, hstore_contains(), HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, ReturnSetInfo::isDone, PG_FUNCTION_INFO_V1(), 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.
Referenced by hstore_skeys().
Datum hstore_to_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 827 of file hstore_op.c.
References hstore_to_array_internal(), hstore_to_matrix(), PG_FUNCTION_INFO_V1(), PG_GETARG_HSTORE_P, and PG_RETURN_POINTER.
Referenced by hstore_to_array_internal().
Definition at line 777 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_to_array(), HSTORE_VAL, HSTORE_VALISNULL, HSTORE_VALLEN, i, sort-test::key, palloc(), PG_FUNCTION_INFO_V1(), PointerGetDatum, and STRPTR.
Referenced by hstore_to_array(), and hstore_to_matrix().
Datum hstore_to_matrix | ( | PG_FUNCTION_ARGS | ) |
Definition at line 837 of file hstore_op.c.
References hstore_to_array_internal(), PG_GETARG_HSTORE_P, and PG_RETURN_POINTER.
Referenced by hstore_to_array().
Definition at line 73 of file hstore_op.c.
References deconstruct_array(), ereport, errcode(), errmsg(), ERROR, hstore_fetchval(), hstoreUniquePairs, i, Pairs::isnull, Pairs::key, Pairs::keylen, MaxAllocSize, Pairs::needfree, palloc(), PG_FUNCTION_INFO_V1(), 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(), and hstore_slice_to_hstore().
PG_FUNCTION_INFO_V1 | ( | hstore_fetchval | ) |
Referenced by hstore_akeys(), hstore_cmp(), hstore_concat(), hstore_contained(), hstore_contains(), hstore_defined(), hstore_delete(), hstore_delete_array(), hstore_delete_hstore(), hstore_each(), hstore_eq(), hstore_exists(), hstore_exists_all(), hstore_exists_any(), hstore_fetchval(), hstore_ge(), hstore_gt(), hstore_hash(), hstore_le(), hstore_lt(), hstore_ne(), hstore_skeys(), hstore_slice_to_array(), hstore_slice_to_hstore(), hstore_svals(), hstore_to_array(), hstore_to_array_internal(), hstoreArrayToPairs(), and setup_firstcall().
PG_FUNCTION_INFO_V1 | ( | hstore_exists | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_exists_any | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_exists_all | ) |
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_concat | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_slice_to_array | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_slice_to_hstore | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_akeys | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_avals | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_to_array | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_to_matrix | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_skeys | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_svals | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_contains | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_contained | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_each | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_cmp | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_eq | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_ne | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_gt | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_ge | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_lt | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_le | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_hash | ) |
PG_FUNCTION_INFO_V1 | ( | hstore_hash_extended | ) |
|
static |
Definition at line 855 of file hstore_op.c.
References BlessTupleDesc(), elog, ERROR, get_call_result_type(), hstore_skeys(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, palloc(), PG_FUNCTION_INFO_V1(), FuncCallContext::tuple_desc, TYPEFUNC_COMPOSITE, FuncCallContext::user_fctx, and VARSIZE.
Referenced by hstore_each(), hstore_skeys(), and hstore_svals().