2008-05-17 05:28:26 +04:00
|
|
|
/*
|
2010-09-21 00:08:53 +04:00
|
|
|
* contrib/btree_gist/btree_utils_var.h
|
2008-05-17 05:28:26 +04:00
|
|
|
*/
|
2006-07-11 01:03:58 +04:00
|
|
|
#ifndef __BTREE_UTILS_VAR_H__
|
|
|
|
#define __BTREE_UTILS_VAR_H__
|
|
|
|
|
2011-09-01 18:03:22 +04:00
|
|
|
#include "access/gist.h"
|
2019-11-25 05:38:57 +03:00
|
|
|
#include "btree_gist.h"
|
2006-07-14 09:28:29 +04:00
|
|
|
#include "mb/pg_wchar.h"
|
|
|
|
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
/* Variable length key */
|
|
|
|
typedef bytea GBT_VARKEY;
|
|
|
|
|
|
|
|
/* Better readable key */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
bytea *lower,
|
|
|
|
*upper;
|
|
|
|
} GBT_VARKEY_R;
|
|
|
|
|
|
|
|
/*
|
2011-04-23 04:19:58 +04:00
|
|
|
* type description
|
|
|
|
*/
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Attribs */
|
|
|
|
|
|
|
|
enum gbtree_type t; /* data type */
|
2005-07-01 17:44:56 +04:00
|
|
|
int32 eml; /* cached pg_database_encoding_max_length (0:
|
|
|
|
* undefined) */
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
bool trnc; /* truncate (=compress) key */
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
2017-03-21 16:53:35 +03:00
|
|
|
bool (*f_gt) (const void *, const void *, Oid, FmgrInfo *); /* greater than */
|
|
|
|
bool (*f_ge) (const void *, const void *, Oid, FmgrInfo *); /* greater equal */
|
|
|
|
bool (*f_eq) (const void *, const void *, Oid, FmgrInfo *); /* equal */
|
|
|
|
bool (*f_le) (const void *, const void *, Oid, FmgrInfo *); /* less equal */
|
|
|
|
bool (*f_lt) (const void *, const void *, Oid, FmgrInfo *); /* less than */
|
|
|
|
int32 (*f_cmp) (const void *, const void *, Oid, FmgrInfo *); /* compare */
|
|
|
|
GBT_VARKEY *(*f_l2n) (GBT_VARKEY *, FmgrInfo *flinfo); /* convert leaf to node */
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
} gbtree_vinfo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern GBT_VARKEY_R gbt_var_key_readable(const GBT_VARKEY *k);
|
|
|
|
|
2015-03-27 00:10:10 +03:00
|
|
|
extern GBT_VARKEY *gbt_var_key_copy(const GBT_VARKEY_R *u);
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
|
|
|
|
extern GISTENTRY *gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo);
|
|
|
|
|
|
|
|
extern GBT_VARKEY *gbt_var_union(const GistEntryVector *entryvec, int32 *size,
|
2017-03-21 16:53:35 +03:00
|
|
|
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
|
2011-04-23 04:19:58 +04:00
|
|
|
extern bool gbt_var_same(Datum d1, Datum d2, Oid collation,
|
2017-03-21 16:53:35 +03:00
|
|
|
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
|
|
|
|
extern float *gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
|
2017-03-21 16:53:35 +03:00
|
|
|
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
|
|
|
|
extern bool gbt_var_consistent(GBT_VARKEY_R *key, const void *query,
|
2011-04-23 04:19:58 +04:00
|
|
|
StrategyNumber strategy, Oid collation, bool is_leaf,
|
2017-03-21 16:53:35 +03:00
|
|
|
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 14:43:32 +04:00
|
|
|
|
|
|
|
extern GIST_SPLITVEC *gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
|
2017-03-21 16:53:35 +03:00
|
|
|
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
2011-04-23 04:19:58 +04:00
|
|
|
|
|
|
|
extern void gbt_var_bin_union(Datum *u, GBT_VARKEY *e, Oid collation,
|
2017-03-21 16:53:35 +03:00
|
|
|
const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
|
2006-07-11 01:03:58 +04:00
|
|
|
|
|
|
|
#endif
|