Fix boilerplate comments in btree_gist
A few of these were copy-pasted wrong, like the comment "Bytea ops" in btree_numeric.c. Instead of fixing the incorrect ones, replace them all with generic comment "GiST support functions". Also tidy up the inconsistent newlines between various functions while we're at it.
This commit is contained in:
parent
82a46cca99
commit
9370978da8
@ -8,10 +8,7 @@
|
||||
#include "utils/fmgrprotos.h"
|
||||
#include "utils/varbit.h"
|
||||
|
||||
|
||||
/*
|
||||
** Bit ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_bit_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_bit_union);
|
||||
PG_FUNCTION_INFO_V1(gbt_bit_picksplit);
|
||||
@ -121,7 +118,7 @@ static const gbtree_vinfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* Bit ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
Datum
|
||||
@ -161,8 +158,6 @@ gbt_bit_consistent(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BOOL(retval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bit_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -173,7 +168,6 @@ gbt_bit_union(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bit_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -196,7 +190,6 @@ gbt_bit_same(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bit_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -12,9 +12,7 @@ typedef struct boolkey
|
||||
bool upper;
|
||||
} boolKEY;
|
||||
|
||||
/*
|
||||
** bool ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_bool_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_bool_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_bool_union);
|
||||
@ -82,10 +80,9 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* bool ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bool_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -124,7 +121,6 @@ gbt_bool_consistent(PG_FUNCTION_ARGS)
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bool_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -135,7 +131,6 @@ gbt_bool_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bool_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -7,10 +7,7 @@
|
||||
#include "btree_utils_var.h"
|
||||
#include "utils/fmgrprotos.h"
|
||||
|
||||
|
||||
/*
|
||||
** Bytea ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_bytea_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_bytea_union);
|
||||
PG_FUNCTION_INFO_V1(gbt_bytea_picksplit);
|
||||
@ -69,7 +66,6 @@ gbt_byteacmp(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
|
||||
PointerGetDatum(b)));
|
||||
}
|
||||
|
||||
|
||||
static const gbtree_vinfo tinfo =
|
||||
{
|
||||
gbt_t_bytea,
|
||||
@ -86,10 +82,9 @@ static const gbtree_vinfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* Text ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bytea_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -98,8 +93,6 @@ gbt_bytea_compress(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bytea_consistent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -121,8 +114,6 @@ gbt_bytea_consistent(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BOOL(retval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bytea_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -133,7 +124,6 @@ gbt_bytea_union(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bytea_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -156,7 +146,6 @@ gbt_bytea_same(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bytea_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -14,9 +14,7 @@ typedef struct
|
||||
Cash upper;
|
||||
} cashKEY;
|
||||
|
||||
/*
|
||||
** Cash ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_cash_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_cash_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_cash_union);
|
||||
@ -111,10 +109,10 @@ cash_dist(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_CASH(ra);
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* Cash ops
|
||||
**************************************************/
|
||||
|
||||
/**************************************************
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
Datum
|
||||
gbt_cash_compress(PG_FUNCTION_ARGS)
|
||||
@ -155,7 +153,6 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_cash_distance(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -173,7 +170,6 @@ gbt_cash_distance(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_cash_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -184,7 +180,6 @@ gbt_cash_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_cash_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -14,9 +14,7 @@ typedef struct
|
||||
DateADT upper;
|
||||
} dateKEY;
|
||||
|
||||
/*
|
||||
** date ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_date_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_date_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_date_union);
|
||||
@ -128,11 +126,9 @@ date_dist(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
/**************************************************
|
||||
* date ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_date_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -172,7 +168,6 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_date_distance(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -190,7 +185,6 @@ gbt_date_distance(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_date_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -201,7 +195,6 @@ gbt_date_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_date_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -238,7 +231,6 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_date_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -16,9 +16,7 @@ typedef struct
|
||||
Oid upper;
|
||||
} oidKEY;
|
||||
|
||||
/*
|
||||
** enum ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_enum_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_enum_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_enum_union);
|
||||
@ -99,10 +97,9 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* Enum ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_enum_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -152,7 +149,6 @@ gbt_enum_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_enum_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -13,9 +13,7 @@ typedef struct float4key
|
||||
float4 upper;
|
||||
} float4KEY;
|
||||
|
||||
/*
|
||||
** float4 ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_float4_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_float4_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_float4_union);
|
||||
@ -107,10 +105,9 @@ float4_dist(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
/**************************************************
|
||||
* float4 ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_float4_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -150,7 +147,6 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_float4_distance(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -168,7 +164,6 @@ gbt_float4_distance(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_float4_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -179,7 +174,6 @@ gbt_float4_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_float4_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -13,9 +13,7 @@ typedef struct float8key
|
||||
float8 upper;
|
||||
} float8KEY;
|
||||
|
||||
/*
|
||||
** float8 ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_float8_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_float8_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_float8_union);
|
||||
@ -113,10 +111,10 @@ float8_dist(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_FLOAT8(fabs(r));
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* float8 ops
|
||||
**************************************************/
|
||||
|
||||
/**************************************************
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
Datum
|
||||
gbt_float8_compress(PG_FUNCTION_ARGS)
|
||||
@ -157,7 +155,6 @@ gbt_float8_consistent(PG_FUNCTION_ARGS)
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_float8_distance(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -175,7 +172,6 @@ gbt_float8_distance(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_float8_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -186,7 +182,6 @@ gbt_float8_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_float8_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -14,9 +14,7 @@ typedef struct inetkey
|
||||
double upper;
|
||||
} inetKEY;
|
||||
|
||||
/*
|
||||
** inet ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_inet_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_inet_union);
|
||||
PG_FUNCTION_INFO_V1(gbt_inet_picksplit);
|
||||
@ -85,10 +83,9 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* inet ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_inet_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -114,7 +111,6 @@ gbt_inet_compress(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_inet_consistent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -142,7 +138,6 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
|
||||
&strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_inet_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -153,7 +148,6 @@ gbt_inet_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_inet_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -13,9 +13,7 @@ typedef struct int16key
|
||||
int16 upper;
|
||||
} int16KEY;
|
||||
|
||||
/*
|
||||
** int16 ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_int2_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_int2_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_int2_union);
|
||||
@ -25,6 +23,7 @@ PG_FUNCTION_INFO_V1(gbt_int2_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_int2_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_int2_same);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_int2gt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
@ -112,10 +111,9 @@ int2_dist(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
/**************************************************
|
||||
* int16 ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int2_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -154,7 +152,6 @@ gbt_int2_consistent(PG_FUNCTION_ARGS)
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int2_distance(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -172,7 +169,6 @@ gbt_int2_distance(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int2_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -183,7 +179,6 @@ gbt_int2_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int2_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -13,9 +13,7 @@ typedef struct int32key
|
||||
int32 upper;
|
||||
} int32KEY;
|
||||
|
||||
/*
|
||||
** int32 ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_int4_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_int4_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_int4_union);
|
||||
@ -25,7 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_int4_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_int4_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_int4_same);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_int4gt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
@ -113,10 +110,9 @@ int4_dist(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
/**************************************************
|
||||
* int32 ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int4_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -155,7 +151,6 @@ gbt_int4_consistent(PG_FUNCTION_ARGS)
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int4_distance(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -173,7 +168,6 @@ gbt_int4_distance(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int4_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -184,7 +178,6 @@ gbt_int4_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int4_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -13,9 +13,7 @@ typedef struct int64key
|
||||
int64 upper;
|
||||
} int64KEY;
|
||||
|
||||
/*
|
||||
** int64 ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_int8_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_int8_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_int8_union);
|
||||
@ -113,10 +111,9 @@ int8_dist(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
/**************************************************
|
||||
* int64 ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int8_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -155,7 +152,6 @@ gbt_int8_consistent(PG_FUNCTION_ARGS)
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int8_distance(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -173,7 +169,6 @@ gbt_int8_distance(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int8_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -184,7 +179,6 @@ gbt_int8_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_int8_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -14,10 +14,7 @@ typedef struct
|
||||
upper;
|
||||
} intvKEY;
|
||||
|
||||
|
||||
/*
|
||||
** Interval ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_intv_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_intv_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_intv_decompress);
|
||||
@ -137,10 +134,9 @@ interval_dist(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
/**************************************************
|
||||
* interval ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_intv_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -15,9 +15,7 @@ typedef struct
|
||||
char pad[4]; /* make struct size = sizeof(gbtreekey16) */
|
||||
} macKEY;
|
||||
|
||||
/*
|
||||
** OID ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_macad_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_macad_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_macad_union);
|
||||
@ -88,11 +86,9 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* macaddr ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
|
||||
static uint64
|
||||
mac_2_uint64(macaddr *m)
|
||||
{
|
||||
@ -105,8 +101,6 @@ mac_2_uint64(macaddr *m)
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_macad_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -15,9 +15,7 @@ typedef struct
|
||||
/* make struct size = sizeof(gbtreekey16) */
|
||||
} mac8KEY;
|
||||
|
||||
/*
|
||||
** OID ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_macad8_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_macad8_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_macad8_union);
|
||||
@ -26,7 +24,6 @@ PG_FUNCTION_INFO_V1(gbt_macad8_consistent);
|
||||
PG_FUNCTION_INFO_V1(gbt_macad8_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_macad8_same);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_macad8gt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
@ -88,11 +85,9 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* macaddr ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
|
||||
static uint64
|
||||
mac8_2_uint64(macaddr8 *m)
|
||||
{
|
||||
@ -105,8 +100,6 @@ mac8_2_uint64(macaddr8 *m)
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_macad8_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -145,7 +138,6 @@ gbt_macad8_consistent(PG_FUNCTION_ARGS)
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_macad8_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -156,7 +148,6 @@ gbt_macad8_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_macad8_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -12,9 +12,7 @@
|
||||
#include "utils/numeric.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
/*
|
||||
** Bytea ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_numeric_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_numeric_union);
|
||||
PG_FUNCTION_INFO_V1(gbt_numeric_picksplit);
|
||||
@ -90,10 +88,9 @@ static const gbtree_vinfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* Text ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_numeric_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -102,8 +99,6 @@ gbt_numeric_compress(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_numeric_consistent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -125,8 +120,6 @@ gbt_numeric_consistent(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BOOL(retval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_numeric_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -137,7 +130,6 @@ gbt_numeric_union(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_numeric_same(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -149,7 +141,6 @@ gbt_numeric_same(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_numeric_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -215,8 +206,6 @@ gbt_numeric_penalty(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_numeric_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -12,9 +12,7 @@ typedef struct
|
||||
Oid upper;
|
||||
} oidKEY;
|
||||
|
||||
/*
|
||||
** OID ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_oid_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_oid_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_oid_union);
|
||||
@ -113,10 +111,9 @@ oid_dist(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
/**************************************************
|
||||
* Oid ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_oid_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -155,7 +152,6 @@ gbt_oid_consistent(PG_FUNCTION_ARGS)
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_oid_distance(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -173,7 +169,6 @@ gbt_oid_distance(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_oid_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -184,7 +179,6 @@ gbt_oid_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_oid_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -8,9 +8,7 @@
|
||||
#include "mb/pg_wchar.h"
|
||||
#include "utils/fmgrprotos.h"
|
||||
|
||||
/*
|
||||
** Text ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_text_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_bpchar_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_text_union);
|
||||
@ -163,10 +161,9 @@ static gbtree_vinfo bptinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* Text ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_text_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -187,8 +184,6 @@ gbt_bpchar_compress(PG_FUNCTION_ARGS)
|
||||
return gbt_text_compress(fcinfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_text_consistent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -216,7 +211,6 @@ gbt_text_consistent(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BOOL(retval);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_bpchar_consistent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -243,7 +237,6 @@ gbt_bpchar_consistent(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BOOL(retval);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_text_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -254,7 +247,6 @@ gbt_text_union(PG_FUNCTION_ARGS)
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_text_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -277,7 +269,6 @@ gbt_text_same(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_text_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -15,9 +15,7 @@ typedef struct
|
||||
TimeADT upper;
|
||||
} timeKEY;
|
||||
|
||||
/*
|
||||
** time ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_time_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_timetz_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_time_fetch);
|
||||
@ -92,8 +90,6 @@ gbt_timelt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
TimeADTGetDatumFast(*bb)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
gbt_timekey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
@ -150,11 +146,9 @@ time_dist(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
/**************************************************
|
||||
* time ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
|
||||
Datum
|
||||
gbt_time_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -163,7 +157,6 @@ gbt_time_compress(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_compress(entry, &tinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_timetz_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -262,7 +255,6 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS)
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_time_union(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -273,7 +265,6 @@ gbt_time_union(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_time_penalty(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -313,7 +304,6 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_time_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -17,9 +17,7 @@ typedef struct
|
||||
Timestamp upper;
|
||||
} tsKEY;
|
||||
|
||||
/*
|
||||
** timestamp ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_ts_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_tstz_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_ts_fetch);
|
||||
@ -40,6 +38,8 @@ PG_FUNCTION_INFO_V1(gbt_ts_same);
|
||||
#endif
|
||||
|
||||
|
||||
/* define for comparison */
|
||||
|
||||
static bool
|
||||
gbt_tsgt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
@ -95,7 +95,6 @@ gbt_tslt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
TimestampGetDatumFast(*bb)));
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
gbt_tskey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
@ -126,7 +125,6 @@ gbt_ts_dist(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
return fabs(INTERVAL_TO_SEC(i));
|
||||
}
|
||||
|
||||
|
||||
static const gbtree_ninfo tinfo =
|
||||
{
|
||||
gbt_t_ts,
|
||||
@ -190,12 +188,10 @@ tstz_dist(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_INTERVAL_P(abs_interval(r));
|
||||
}
|
||||
|
||||
|
||||
/**************************************************
|
||||
* timestamp ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
static inline Timestamp
|
||||
tstz_to_ts_gmt(TimestampTz ts)
|
||||
{
|
||||
@ -212,7 +208,6 @@ gbt_ts_compress(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_compress(entry, &tinfo));
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
gbt_tstz_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -15,9 +15,7 @@ typedef struct
|
||||
} uuidKEY;
|
||||
|
||||
|
||||
/*
|
||||
* UUID ops
|
||||
*/
|
||||
/* GiST support functions */
|
||||
PG_FUNCTION_INFO_V1(gbt_uuid_compress);
|
||||
PG_FUNCTION_INFO_V1(gbt_uuid_fetch);
|
||||
PG_FUNCTION_INFO_V1(gbt_uuid_union);
|
||||
@ -93,10 +91,9 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
/**************************************************
|
||||
* uuid ops
|
||||
* GiST support functions
|
||||
**************************************************/
|
||||
|
||||
|
||||
Datum
|
||||
gbt_uuid_compress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user