2008-05-17 09:28:26 +08:00
|
|
|
/*
|
|
|
|
* $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_var.h,v 1.8 2008/05/17 01:28:19 adunstan Exp $
|
|
|
|
*/
|
2006-07-11 05:03:58 +08:00
|
|
|
#ifndef __BTREE_UTILS_VAR_H__
|
|
|
|
#define __BTREE_UTILS_VAR_H__
|
|
|
|
|
2006-07-11 02:40:16 +08:00
|
|
|
#include "btree_gist.h"
|
|
|
|
|
2006-07-14 13:28:29 +08: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 18:43:32 +08:00
|
|
|
/* Variable length key */
|
|
|
|
typedef bytea GBT_VARKEY;
|
|
|
|
|
|
|
|
/* Better readable key */
|
|
|
|
typedef struct
|
|
|
|
{
|
2004-08-29 13:07:03 +08:00
|
|
|
bytea *lower,
|
|
|
|
*upper;
|
|
|
|
} GBT_VARKEY_R;
|
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 18:43:32 +08:00
|
|
|
|
|
|
|
/* used for key sorting */
|
|
|
|
typedef struct
|
|
|
|
{
|
2004-08-29 13:07:03 +08:00
|
|
|
int i;
|
|
|
|
GBT_VARKEY *t;
|
|
|
|
} Vsrt;
|
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 18:43:32 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
type description
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
/* Attribs */
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
enum gbtree_type t; /* data type */
|
2005-10-15 10:49:52 +08:00
|
|
|
int32 eml; /* cached pg_database_encoding_max_length (0:
|
|
|
|
* undefined) */
|
2004-08-29 13:07:03 +08:00
|
|
|
bool trnc; /* truncate (=compress) key */
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
/* Methods */
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
bool (*f_gt) (const void *, const void *); /* greater then */
|
|
|
|
bool (*f_ge) (const void *, const void *); /* greater equal */
|
|
|
|
bool (*f_eq) (const void *, const void *); /* equal */
|
|
|
|
bool (*f_le) (const void *, const void *); /* less equal */
|
|
|
|
bool (*f_lt) (const void *, const void *); /* less then */
|
|
|
|
int32 (*f_cmp) (const bytea *, const bytea *); /* node compare */
|
|
|
|
GBT_VARKEY *(*f_l2n) (GBT_VARKEY *); /* convert leaf to node */
|
|
|
|
} gbtree_vinfo;
|
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 18:43:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
extern GBT_VARKEY_R gbt_var_key_readable(const GBT_VARKEY * k);
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
extern GBT_VARKEY *gbt_var_key_copy(const GBT_VARKEY_R * u, bool force_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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
extern GISTENTRY *gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo * tinfo);
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
extern GBT_VARKEY *gbt_var_union(const GistEntryVector *entryvec, int32 *size,
|
|
|
|
const gbtree_vinfo * tinfo);
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
extern bool gbt_var_same(bool *result, const Datum d1, const Datum d2,
|
|
|
|
const gbtree_vinfo * tinfo);
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
extern float *gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
|
|
|
|
const gbtree_vinfo * tinfo);
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
extern bool gbt_var_consistent(GBT_VARKEY_R * key, const void *query,
|
|
|
|
const StrategyNumber *strategy, bool is_leaf,
|
|
|
|
const gbtree_vinfo * tinfo);
|
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 18:43:32 +08:00
|
|
|
|
2004-08-29 13:07:03 +08:00
|
|
|
extern GIST_SPLITVEC *gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
|
|
|
|
const gbtree_vinfo * tinfo);
|
|
|
|
extern void gbt_var_bin_union(Datum *u, GBT_VARKEY * e,
|
|
|
|
const gbtree_vinfo * tinfo);
|
2006-07-11 05:03:58 +08:00
|
|
|
|
|
|
|
#endif
|