PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | HEntry |
struct | HStore |
struct | Pairs |
Macros | |
#define | HENTRY_ISFIRST 0x80000000 |
#define | HENTRY_ISNULL 0x40000000 |
#define | HENTRY_POSMASK 0x3FFFFFFF |
#define | HSE_ISFIRST(he_) (((he_).entry & HENTRY_ISFIRST) != 0) |
#define | HSE_ISNULL(he_) (((he_).entry & HENTRY_ISNULL) != 0) |
#define | HSE_ENDPOS(he_) ((he_).entry & HENTRY_POSMASK) |
#define | HSE_OFF(he_) (HSE_ISFIRST(he_) ? 0 : HSE_ENDPOS((&(he_))[-1])) |
#define | HSE_LEN(he_) |
#define | HSTORE_MAX_KEY_LEN 0x3FFFFFFF |
#define | HSTORE_MAX_VALUE_LEN 0x3FFFFFFF |
#define | HS_FLAG_NEWVERSION 0x80000000 |
#define | HS_COUNT(hsp_) ((hsp_)->size_ & 0x0FFFFFFF) |
#define | HS_SETCOUNT(hsp_, c_) ((hsp_)->size_ = (c_) | HS_FLAG_NEWVERSION) |
#define | HSHRDSIZE (sizeof(HStore)) |
#define | CALCDATASIZE(x, lenstr) ( (x) * 2 * sizeof(HEntry) + HSHRDSIZE + (lenstr) ) |
#define | ARRPTR(x) ( (HEntry*) ( (HStore*)(x) + 1 ) ) |
#define | STRPTR(x) ( (char*)(ARRPTR(x) + HS_COUNT((HStore*)(x)) * 2) ) |
#define | HSTORE_KEY(arr_, str_, i_) ((str_) + HSE_OFF((arr_)[2*(i_)])) |
#define | HSTORE_VAL(arr_, str_, i_) ((str_) + HSE_OFF((arr_)[2*(i_)+1])) |
#define | HSTORE_KEYLEN(arr_, i_) (HSE_LEN((arr_)[2*(i_)])) |
#define | HSTORE_VALLEN(arr_, i_) (HSE_LEN((arr_)[2*(i_)+1])) |
#define | HSTORE_VALISNULL(arr_, i_) (HSE_ISNULL((arr_)[2*(i_)+1])) |
#define | HS_COPYITEM(dent_, dbuf_, dptr_, sptr_, klen_, vlen_, vnull_) |
#define | HS_ADDITEM(dent_, dbuf_, dptr_, pair_) |
#define | HS_FINALIZE(hsp_, count_, buf_, ptr_) |
#define | HS_FIXSIZE(hsp_, count_) |
#define | DatumGetHStoreP(d) hstoreUpgrade(d) |
#define | PG_GETARG_HSTORE_P(x) DatumGetHStoreP(PG_GETARG_DATUM(x)) |
#define | HStoreContainsStrategyNumber 7 |
#define | HStoreExistsStrategyNumber 9 |
#define | HStoreExistsAnyStrategyNumber 10 |
#define | HStoreExistsAllStrategyNumber 11 |
#define | HStoreOldContainsStrategyNumber 13 /* backwards compatibility */ |
#define | HSTORE_POLLUTE_NAMESPACE 1 |
#define | HSTORE_POLLUTE(newname_, oldname_) |
Functions | |
PGDLLEXPORT HStore * | hstoreUpgrade (Datum orig) |
PGDLLEXPORT int | hstoreUniquePairs (Pairs *a, int32 l, int32 *buflen) |
PGDLLEXPORT HStore * | hstorePairs (Pairs *pairs, int32 pcount, int32 buflen) |
PGDLLEXPORT size_t | hstoreCheckKeyLen (size_t len) |
PGDLLEXPORT size_t | hstoreCheckValLen (size_t len) |
PGDLLEXPORT int | hstoreFindKey (HStore *hs, int *lowbound, char *key, int keylen) |
PGDLLEXPORT Pairs * | hstoreArrayToPairs (ArrayType *a, int *npairs) |
#define DatumGetHStoreP | ( | d | ) | hstoreUpgrade(d) |
#define HS_ADDITEM | ( | dent_, | |
dbuf_, | |||
dptr_, | |||
pair_ | |||
) |
#define HS_COPYITEM | ( | dent_, | |
dbuf_, | |||
dptr_, | |||
sptr_, | |||
klen_, | |||
vlen_, | |||
vnull_ | |||
) |
#define HS_FINALIZE | ( | hsp_, | |
count_, | |||
buf_, | |||
ptr_ | |||
) |
#define HS_FIXSIZE | ( | hsp_, | |
count_ | |||
) |
#define HS_SETCOUNT | ( | hsp_, | |
c_ | |||
) | ((hsp_)->size_ = (c_) | HS_FLAG_NEWVERSION) |
#define HSE_ENDPOS | ( | he_ | ) | ((he_).entry & HENTRY_POSMASK) |
#define HSE_ISFIRST | ( | he_ | ) | (((he_).entry & HENTRY_ISFIRST) != 0) |
#define HSE_ISNULL | ( | he_ | ) | (((he_).entry & HENTRY_ISNULL) != 0) |
#define HSE_LEN | ( | he_ | ) |
#define HSE_OFF | ( | he_ | ) | (HSE_ISFIRST(he_) ? 0 : HSE_ENDPOS((&(he_))[-1])) |
#define HSTORE_KEY | ( | arr_, | |
str_, | |||
i_ | |||
) | ((str_) + HSE_OFF((arr_)[2*(i_)])) |
#define HSTORE_KEYLEN | ( | arr_, | |
i_ | |||
) | (HSE_LEN((arr_)[2*(i_)])) |
#define HSTORE_POLLUTE | ( | newname_, | |
oldname_ | |||
) |
#define HSTORE_VAL | ( | arr_, | |
str_, | |||
i_ | |||
) | ((str_) + HSE_OFF((arr_)[2*(i_)+1])) |
#define HSTORE_VALISNULL | ( | arr_, | |
i_ | |||
) | (HSE_ISNULL((arr_)[2*(i_)+1])) |
#define HSTORE_VALLEN | ( | arr_, | |
i_ | |||
) | (HSE_LEN((arr_)[2*(i_)+1])) |
#define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */ |
#define PG_GETARG_HSTORE_P | ( | x | ) | DatumGetHStoreP(PG_GETARG_DATUM(x)) |
PGDLLEXPORT Pairs* hstoreArrayToPairs | ( | ArrayType * | a, |
int * | npairs | ||
) |
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().
PGDLLEXPORT size_t hstoreCheckKeyLen | ( | size_t | len | ) |
Definition at line 404 of file hstore_io.c.
References ereport, errcode(), errmsg(), ERROR, HSTORE_MAX_KEY_LEN, and len.
Referenced by hstore_from_array(), hstore_from_arrays(), hstore_from_record(), hstore_from_text(), and hstore_recv().
PGDLLEXPORT size_t hstoreCheckValLen | ( | size_t | len | ) |
Definition at line 424 of file hstore_io.c.
References ereport, errcode(), errmsg(), ERROR, HSTORE_MAX_VALUE_LEN, and len.
Referenced by hstore_from_array(), hstore_from_arrays(), hstore_from_record(), hstore_from_text(), and hstore_recv().
PGDLLEXPORT 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().
PGDLLEXPORT HStore* hstorePairs | ( | Pairs * | pairs, |
int32 | pcount, | ||
int32 | buflen | ||
) |
Definition at line 445 of file hstore_io.c.
References ARRPTR, buf, CALCDATASIZE, HS_ADDITEM, HS_FINALIZE, HS_SETCOUNT, i, len, palloc(), SET_VARSIZE, and STRPTR.
Referenced by hstore_from_array(), hstore_from_arrays(), hstore_from_record(), hstore_from_text(), hstore_in(), and hstore_recv().
PGDLLEXPORT int hstoreUniquePairs | ( | Pairs * | a, |
int32 | l, | ||
int32 * | buflen | ||
) |
Definition at line 356 of file hstore_io.c.
References a, comparePairs(), Pairs::key, Pairs::keylen, Pairs::needfree, pfree(), qsort, res, and Pairs::val.
Referenced by hstore_from_array(), hstore_from_arrays(), hstore_from_record(), hstore_in(), and hstore_recv().
PGDLLEXPORT HStore* hstoreUpgrade | ( | Datum | orig | ) |
Definition at line 236 of file hstore_compat.c.
References ARRPTR, DatumGetPointer(), elog, HEntry::entry, ERROR, HENTRY_ISFIRST, HENTRY_ISNULL, HENTRY_POSMASK, HS_COUNT, HS_FIXSIZE, HS_FLAG_NEWVERSION, HS_SETCOUNT, HSE_ISFIRST, hstoreValidNewFormat(), hstoreValidOldFormat(), i, HOldEntry::keylen, PG_DETOAST_DATUM, PG_DETOAST_DATUM_COPY, HOldEntry::pos, HStore::size_, HOldEntry::valisnull, HOldEntry::vallen, VARSIZE, and WARNING.