1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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:
Heikki Linnakangas
2025-04-03 13:39:33 +03:00
parent 82a46cca99
commit 9370978da8
21 changed files with 49 additions and 187 deletions

View File

@ -8,10 +8,7 @@
#include "utils/fmgrprotos.h" #include "utils/fmgrprotos.h"
#include "utils/varbit.h" #include "utils/varbit.h"
/* GiST support functions */
/*
** Bit ops
*/
PG_FUNCTION_INFO_V1(gbt_bit_compress); PG_FUNCTION_INFO_V1(gbt_bit_compress);
PG_FUNCTION_INFO_V1(gbt_bit_union); PG_FUNCTION_INFO_V1(gbt_bit_union);
PG_FUNCTION_INFO_V1(gbt_bit_picksplit); PG_FUNCTION_INFO_V1(gbt_bit_picksplit);
@ -121,7 +118,7 @@ static const gbtree_vinfo tinfo =
/************************************************** /**************************************************
* Bit ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
@ -161,8 +158,6 @@ gbt_bit_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval); PG_RETURN_BOOL(retval);
} }
Datum Datum
gbt_bit_union(PG_FUNCTION_ARGS) gbt_bit_union(PG_FUNCTION_ARGS)
{ {
@ -173,7 +168,6 @@ gbt_bit_union(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_bit_picksplit(PG_FUNCTION_ARGS) gbt_bit_picksplit(PG_FUNCTION_ARGS)
{ {
@ -196,7 +190,6 @@ gbt_bit_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result); PG_RETURN_POINTER(result);
} }
Datum Datum
gbt_bit_penalty(PG_FUNCTION_ARGS) gbt_bit_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -12,9 +12,7 @@ typedef struct boolkey
bool upper; bool upper;
} boolKEY; } boolKEY;
/* /* GiST support functions */
** bool ops
*/
PG_FUNCTION_INFO_V1(gbt_bool_compress); PG_FUNCTION_INFO_V1(gbt_bool_compress);
PG_FUNCTION_INFO_V1(gbt_bool_fetch); PG_FUNCTION_INFO_V1(gbt_bool_fetch);
PG_FUNCTION_INFO_V1(gbt_bool_union); PG_FUNCTION_INFO_V1(gbt_bool_union);
@ -82,10 +80,9 @@ static const gbtree_ninfo tinfo =
/************************************************** /**************************************************
* bool ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_bool_compress(PG_FUNCTION_ARGS) gbt_bool_compress(PG_FUNCTION_ARGS)
{ {
@ -124,7 +121,6 @@ gbt_bool_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_bool_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_bool_penalty(PG_FUNCTION_ARGS) gbt_bool_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -7,10 +7,7 @@
#include "btree_utils_var.h" #include "btree_utils_var.h"
#include "utils/fmgrprotos.h" #include "utils/fmgrprotos.h"
/* GiST support functions */
/*
** Bytea ops
*/
PG_FUNCTION_INFO_V1(gbt_bytea_compress); PG_FUNCTION_INFO_V1(gbt_bytea_compress);
PG_FUNCTION_INFO_V1(gbt_bytea_union); PG_FUNCTION_INFO_V1(gbt_bytea_union);
PG_FUNCTION_INFO_V1(gbt_bytea_picksplit); 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))); PointerGetDatum(b)));
} }
static const gbtree_vinfo tinfo = static const gbtree_vinfo tinfo =
{ {
gbt_t_bytea, gbt_t_bytea,
@ -86,10 +82,9 @@ static const gbtree_vinfo tinfo =
/************************************************** /**************************************************
* Text ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_bytea_compress(PG_FUNCTION_ARGS) gbt_bytea_compress(PG_FUNCTION_ARGS)
{ {
@ -98,8 +93,6 @@ gbt_bytea_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo)); PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo));
} }
Datum Datum
gbt_bytea_consistent(PG_FUNCTION_ARGS) gbt_bytea_consistent(PG_FUNCTION_ARGS)
{ {
@ -121,8 +114,6 @@ gbt_bytea_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval); PG_RETURN_BOOL(retval);
} }
Datum Datum
gbt_bytea_union(PG_FUNCTION_ARGS) gbt_bytea_union(PG_FUNCTION_ARGS)
{ {
@ -133,7 +124,6 @@ gbt_bytea_union(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_bytea_picksplit(PG_FUNCTION_ARGS) gbt_bytea_picksplit(PG_FUNCTION_ARGS)
{ {
@ -156,7 +146,6 @@ gbt_bytea_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result); PG_RETURN_POINTER(result);
} }
Datum Datum
gbt_bytea_penalty(PG_FUNCTION_ARGS) gbt_bytea_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -14,9 +14,7 @@ typedef struct
Cash upper; Cash upper;
} cashKEY; } cashKEY;
/* /* GiST support functions */
** Cash ops
*/
PG_FUNCTION_INFO_V1(gbt_cash_compress); PG_FUNCTION_INFO_V1(gbt_cash_compress);
PG_FUNCTION_INFO_V1(gbt_cash_fetch); PG_FUNCTION_INFO_V1(gbt_cash_fetch);
PG_FUNCTION_INFO_V1(gbt_cash_union); PG_FUNCTION_INFO_V1(gbt_cash_union);
@ -111,10 +109,10 @@ cash_dist(PG_FUNCTION_ARGS)
PG_RETURN_CASH(ra); PG_RETURN_CASH(ra);
} }
/**************************************************
* Cash ops
**************************************************/
/**************************************************
* GiST support functions
**************************************************/
Datum Datum
gbt_cash_compress(PG_FUNCTION_ARGS) gbt_cash_compress(PG_FUNCTION_ARGS)
@ -155,7 +153,6 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
fcinfo->flinfo)); fcinfo->flinfo));
} }
Datum Datum
gbt_cash_distance(PG_FUNCTION_ARGS) gbt_cash_distance(PG_FUNCTION_ARGS)
{ {
@ -173,7 +170,6 @@ gbt_cash_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_cash_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_cash_penalty(PG_FUNCTION_ARGS) gbt_cash_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -14,9 +14,7 @@ typedef struct
DateADT upper; DateADT upper;
} dateKEY; } dateKEY;
/* /* GiST support functions */
** date ops
*/
PG_FUNCTION_INFO_V1(gbt_date_compress); PG_FUNCTION_INFO_V1(gbt_date_compress);
PG_FUNCTION_INFO_V1(gbt_date_fetch); PG_FUNCTION_INFO_V1(gbt_date_fetch);
PG_FUNCTION_INFO_V1(gbt_date_union); PG_FUNCTION_INFO_V1(gbt_date_union);
@ -128,11 +126,9 @@ date_dist(PG_FUNCTION_ARGS)
/************************************************** /**************************************************
* date ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_date_compress(PG_FUNCTION_ARGS) gbt_date_compress(PG_FUNCTION_ARGS)
{ {
@ -172,7 +168,6 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
fcinfo->flinfo)); fcinfo->flinfo));
} }
Datum Datum
gbt_date_distance(PG_FUNCTION_ARGS) gbt_date_distance(PG_FUNCTION_ARGS)
{ {
@ -190,7 +185,6 @@ gbt_date_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_date_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_date_penalty(PG_FUNCTION_ARGS) gbt_date_penalty(PG_FUNCTION_ARGS)
{ {
@ -238,7 +231,6 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result); PG_RETURN_POINTER(result);
} }
Datum Datum
gbt_date_picksplit(PG_FUNCTION_ARGS) gbt_date_picksplit(PG_FUNCTION_ARGS)
{ {

View File

@ -16,9 +16,7 @@ typedef struct
Oid upper; Oid upper;
} oidKEY; } oidKEY;
/* /* GiST support functions */
** enum ops
*/
PG_FUNCTION_INFO_V1(gbt_enum_compress); PG_FUNCTION_INFO_V1(gbt_enum_compress);
PG_FUNCTION_INFO_V1(gbt_enum_fetch); PG_FUNCTION_INFO_V1(gbt_enum_fetch);
PG_FUNCTION_INFO_V1(gbt_enum_union); PG_FUNCTION_INFO_V1(gbt_enum_union);
@ -99,10 +97,9 @@ static const gbtree_ninfo tinfo =
/************************************************** /**************************************************
* Enum ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_enum_compress(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_enum_penalty(PG_FUNCTION_ARGS) gbt_enum_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -13,9 +13,7 @@ typedef struct float4key
float4 upper; float4 upper;
} float4KEY; } float4KEY;
/* /* GiST support functions */
** float4 ops
*/
PG_FUNCTION_INFO_V1(gbt_float4_compress); PG_FUNCTION_INFO_V1(gbt_float4_compress);
PG_FUNCTION_INFO_V1(gbt_float4_fetch); PG_FUNCTION_INFO_V1(gbt_float4_fetch);
PG_FUNCTION_INFO_V1(gbt_float4_union); PG_FUNCTION_INFO_V1(gbt_float4_union);
@ -107,10 +105,9 @@ float4_dist(PG_FUNCTION_ARGS)
/************************************************** /**************************************************
* float4 ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_float4_compress(PG_FUNCTION_ARGS) gbt_float4_compress(PG_FUNCTION_ARGS)
{ {
@ -150,7 +147,6 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
fcinfo->flinfo)); fcinfo->flinfo));
} }
Datum Datum
gbt_float4_distance(PG_FUNCTION_ARGS) gbt_float4_distance(PG_FUNCTION_ARGS)
{ {
@ -168,7 +164,6 @@ gbt_float4_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_float4_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_float4_penalty(PG_FUNCTION_ARGS) gbt_float4_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -13,9 +13,7 @@ typedef struct float8key
float8 upper; float8 upper;
} float8KEY; } float8KEY;
/* /* GiST support functions */
** float8 ops
*/
PG_FUNCTION_INFO_V1(gbt_float8_compress); PG_FUNCTION_INFO_V1(gbt_float8_compress);
PG_FUNCTION_INFO_V1(gbt_float8_fetch); PG_FUNCTION_INFO_V1(gbt_float8_fetch);
PG_FUNCTION_INFO_V1(gbt_float8_union); PG_FUNCTION_INFO_V1(gbt_float8_union);
@ -113,10 +111,10 @@ float8_dist(PG_FUNCTION_ARGS)
PG_RETURN_FLOAT8(fabs(r)); PG_RETURN_FLOAT8(fabs(r));
} }
/**************************************************
* float8 ops
**************************************************/
/**************************************************
* GiST support functions
**************************************************/
Datum Datum
gbt_float8_compress(PG_FUNCTION_ARGS) gbt_float8_compress(PG_FUNCTION_ARGS)
@ -157,7 +155,6 @@ gbt_float8_consistent(PG_FUNCTION_ARGS)
fcinfo->flinfo)); fcinfo->flinfo));
} }
Datum Datum
gbt_float8_distance(PG_FUNCTION_ARGS) gbt_float8_distance(PG_FUNCTION_ARGS)
{ {
@ -175,7 +172,6 @@ gbt_float8_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_float8_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_float8_penalty(PG_FUNCTION_ARGS) gbt_float8_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -14,9 +14,7 @@ typedef struct inetkey
double upper; double upper;
} inetKEY; } inetKEY;
/* /* GiST support functions */
** inet ops
*/
PG_FUNCTION_INFO_V1(gbt_inet_compress); PG_FUNCTION_INFO_V1(gbt_inet_compress);
PG_FUNCTION_INFO_V1(gbt_inet_union); PG_FUNCTION_INFO_V1(gbt_inet_union);
PG_FUNCTION_INFO_V1(gbt_inet_picksplit); PG_FUNCTION_INFO_V1(gbt_inet_picksplit);
@ -85,10 +83,9 @@ static const gbtree_ninfo tinfo =
/************************************************** /**************************************************
* inet ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_inet_compress(PG_FUNCTION_ARGS) gbt_inet_compress(PG_FUNCTION_ARGS)
{ {
@ -114,7 +111,6 @@ gbt_inet_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(retval); PG_RETURN_POINTER(retval);
} }
Datum Datum
gbt_inet_consistent(PG_FUNCTION_ARGS) gbt_inet_consistent(PG_FUNCTION_ARGS)
{ {
@ -142,7 +138,6 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
&strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_inet_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_inet_penalty(PG_FUNCTION_ARGS) gbt_inet_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -13,9 +13,7 @@ typedef struct int16key
int16 upper; int16 upper;
} int16KEY; } int16KEY;
/* /* GiST support functions */
** int16 ops
*/
PG_FUNCTION_INFO_V1(gbt_int2_compress); PG_FUNCTION_INFO_V1(gbt_int2_compress);
PG_FUNCTION_INFO_V1(gbt_int2_fetch); PG_FUNCTION_INFO_V1(gbt_int2_fetch);
PG_FUNCTION_INFO_V1(gbt_int2_union); 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_penalty);
PG_FUNCTION_INFO_V1(gbt_int2_same); PG_FUNCTION_INFO_V1(gbt_int2_same);
static bool static bool
gbt_int2gt(const void *a, const void *b, FmgrInfo *flinfo) 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 Datum
gbt_int2_compress(PG_FUNCTION_ARGS) gbt_int2_compress(PG_FUNCTION_ARGS)
{ {
@ -154,7 +152,6 @@ gbt_int2_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int2_distance(PG_FUNCTION_ARGS) gbt_int2_distance(PG_FUNCTION_ARGS)
{ {
@ -172,7 +169,6 @@ gbt_int2_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int2_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int2_penalty(PG_FUNCTION_ARGS) gbt_int2_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -13,9 +13,7 @@ typedef struct int32key
int32 upper; int32 upper;
} int32KEY; } int32KEY;
/* /* GiST support functions */
** int32 ops
*/
PG_FUNCTION_INFO_V1(gbt_int4_compress); PG_FUNCTION_INFO_V1(gbt_int4_compress);
PG_FUNCTION_INFO_V1(gbt_int4_fetch); PG_FUNCTION_INFO_V1(gbt_int4_fetch);
PG_FUNCTION_INFO_V1(gbt_int4_union); 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_penalty);
PG_FUNCTION_INFO_V1(gbt_int4_same); PG_FUNCTION_INFO_V1(gbt_int4_same);
static bool static bool
gbt_int4gt(const void *a, const void *b, FmgrInfo *flinfo) 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 Datum
gbt_int4_compress(PG_FUNCTION_ARGS) gbt_int4_compress(PG_FUNCTION_ARGS)
{ {
@ -155,7 +151,6 @@ gbt_int4_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int4_distance(PG_FUNCTION_ARGS) gbt_int4_distance(PG_FUNCTION_ARGS)
{ {
@ -173,7 +168,6 @@ gbt_int4_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int4_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int4_penalty(PG_FUNCTION_ARGS) gbt_int4_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -13,9 +13,7 @@ typedef struct int64key
int64 upper; int64 upper;
} int64KEY; } int64KEY;
/* /* GiST support functions */
** int64 ops
*/
PG_FUNCTION_INFO_V1(gbt_int8_compress); PG_FUNCTION_INFO_V1(gbt_int8_compress);
PG_FUNCTION_INFO_V1(gbt_int8_fetch); PG_FUNCTION_INFO_V1(gbt_int8_fetch);
PG_FUNCTION_INFO_V1(gbt_int8_union); PG_FUNCTION_INFO_V1(gbt_int8_union);
@ -113,10 +111,9 @@ int8_dist(PG_FUNCTION_ARGS)
/************************************************** /**************************************************
* int64 ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_int8_compress(PG_FUNCTION_ARGS) gbt_int8_compress(PG_FUNCTION_ARGS)
{ {
@ -155,7 +152,6 @@ gbt_int8_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int8_distance(PG_FUNCTION_ARGS) gbt_int8_distance(PG_FUNCTION_ARGS)
{ {
@ -173,7 +169,6 @@ gbt_int8_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int8_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_int8_penalty(PG_FUNCTION_ARGS) gbt_int8_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -14,10 +14,7 @@ typedef struct
upper; upper;
} intvKEY; } intvKEY;
/* GiST support functions */
/*
** Interval ops
*/
PG_FUNCTION_INFO_V1(gbt_intv_compress); PG_FUNCTION_INFO_V1(gbt_intv_compress);
PG_FUNCTION_INFO_V1(gbt_intv_fetch); PG_FUNCTION_INFO_V1(gbt_intv_fetch);
PG_FUNCTION_INFO_V1(gbt_intv_decompress); PG_FUNCTION_INFO_V1(gbt_intv_decompress);
@ -137,10 +134,9 @@ interval_dist(PG_FUNCTION_ARGS)
/************************************************** /**************************************************
* interval ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_intv_compress(PG_FUNCTION_ARGS) gbt_intv_compress(PG_FUNCTION_ARGS)
{ {

View File

@ -15,9 +15,7 @@ typedef struct
char pad[4]; /* make struct size = sizeof(gbtreekey16) */ char pad[4]; /* make struct size = sizeof(gbtreekey16) */
} macKEY; } macKEY;
/* /* GiST support functions */
** OID ops
*/
PG_FUNCTION_INFO_V1(gbt_macad_compress); PG_FUNCTION_INFO_V1(gbt_macad_compress);
PG_FUNCTION_INFO_V1(gbt_macad_fetch); PG_FUNCTION_INFO_V1(gbt_macad_fetch);
PG_FUNCTION_INFO_V1(gbt_macad_union); PG_FUNCTION_INFO_V1(gbt_macad_union);
@ -88,11 +86,9 @@ static const gbtree_ninfo tinfo =
/************************************************** /**************************************************
* macaddr ops * GiST support functions
**************************************************/ **************************************************/
static uint64 static uint64
mac_2_uint64(macaddr *m) mac_2_uint64(macaddr *m)
{ {
@ -105,8 +101,6 @@ mac_2_uint64(macaddr *m)
return res; return res;
} }
Datum Datum
gbt_macad_compress(PG_FUNCTION_ARGS) gbt_macad_compress(PG_FUNCTION_ARGS)
{ {

View File

@ -15,9 +15,7 @@ typedef struct
/* make struct size = sizeof(gbtreekey16) */ /* make struct size = sizeof(gbtreekey16) */
} mac8KEY; } mac8KEY;
/* /* GiST support functions */
** OID ops
*/
PG_FUNCTION_INFO_V1(gbt_macad8_compress); PG_FUNCTION_INFO_V1(gbt_macad8_compress);
PG_FUNCTION_INFO_V1(gbt_macad8_fetch); PG_FUNCTION_INFO_V1(gbt_macad8_fetch);
PG_FUNCTION_INFO_V1(gbt_macad8_union); 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_penalty);
PG_FUNCTION_INFO_V1(gbt_macad8_same); PG_FUNCTION_INFO_V1(gbt_macad8_same);
static bool static bool
gbt_macad8gt(const void *a, const void *b, FmgrInfo *flinfo) 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 static uint64
mac8_2_uint64(macaddr8 *m) mac8_2_uint64(macaddr8 *m)
{ {
@ -105,8 +100,6 @@ mac8_2_uint64(macaddr8 *m)
return res; return res;
} }
Datum Datum
gbt_macad8_compress(PG_FUNCTION_ARGS) gbt_macad8_compress(PG_FUNCTION_ARGS)
{ {
@ -145,7 +138,6 @@ gbt_macad8_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_macad8_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_macad8_penalty(PG_FUNCTION_ARGS) gbt_macad8_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -12,9 +12,7 @@
#include "utils/numeric.h" #include "utils/numeric.h"
#include "utils/rel.h" #include "utils/rel.h"
/* /* GiST support functions */
** Bytea ops
*/
PG_FUNCTION_INFO_V1(gbt_numeric_compress); PG_FUNCTION_INFO_V1(gbt_numeric_compress);
PG_FUNCTION_INFO_V1(gbt_numeric_union); PG_FUNCTION_INFO_V1(gbt_numeric_union);
PG_FUNCTION_INFO_V1(gbt_numeric_picksplit); PG_FUNCTION_INFO_V1(gbt_numeric_picksplit);
@ -90,10 +88,9 @@ static const gbtree_vinfo tinfo =
/************************************************** /**************************************************
* Text ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_numeric_compress(PG_FUNCTION_ARGS) gbt_numeric_compress(PG_FUNCTION_ARGS)
{ {
@ -102,8 +99,6 @@ gbt_numeric_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo)); PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo));
} }
Datum Datum
gbt_numeric_consistent(PG_FUNCTION_ARGS) gbt_numeric_consistent(PG_FUNCTION_ARGS)
{ {
@ -125,8 +120,6 @@ gbt_numeric_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval); PG_RETURN_BOOL(retval);
} }
Datum Datum
gbt_numeric_union(PG_FUNCTION_ARGS) gbt_numeric_union(PG_FUNCTION_ARGS)
{ {
@ -137,7 +130,6 @@ gbt_numeric_union(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_numeric_same(PG_FUNCTION_ARGS) gbt_numeric_same(PG_FUNCTION_ARGS)
{ {
@ -149,7 +141,6 @@ gbt_numeric_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result); PG_RETURN_POINTER(result);
} }
Datum Datum
gbt_numeric_penalty(PG_FUNCTION_ARGS) gbt_numeric_penalty(PG_FUNCTION_ARGS)
{ {
@ -215,8 +206,6 @@ gbt_numeric_penalty(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result); PG_RETURN_POINTER(result);
} }
Datum Datum
gbt_numeric_picksplit(PG_FUNCTION_ARGS) gbt_numeric_picksplit(PG_FUNCTION_ARGS)
{ {

View File

@ -12,9 +12,7 @@ typedef struct
Oid upper; Oid upper;
} oidKEY; } oidKEY;
/* /* GiST support functions */
** OID ops
*/
PG_FUNCTION_INFO_V1(gbt_oid_compress); PG_FUNCTION_INFO_V1(gbt_oid_compress);
PG_FUNCTION_INFO_V1(gbt_oid_fetch); PG_FUNCTION_INFO_V1(gbt_oid_fetch);
PG_FUNCTION_INFO_V1(gbt_oid_union); PG_FUNCTION_INFO_V1(gbt_oid_union);
@ -113,10 +111,9 @@ oid_dist(PG_FUNCTION_ARGS)
/************************************************** /**************************************************
* Oid ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_oid_compress(PG_FUNCTION_ARGS) gbt_oid_compress(PG_FUNCTION_ARGS)
{ {
@ -155,7 +152,6 @@ gbt_oid_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_oid_distance(PG_FUNCTION_ARGS) gbt_oid_distance(PG_FUNCTION_ARGS)
{ {
@ -173,7 +169,6 @@ gbt_oid_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_oid_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_oid_penalty(PG_FUNCTION_ARGS) gbt_oid_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -8,9 +8,7 @@
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
#include "utils/fmgrprotos.h" #include "utils/fmgrprotos.h"
/* /* GiST support functions */
** Text ops
*/
PG_FUNCTION_INFO_V1(gbt_text_compress); PG_FUNCTION_INFO_V1(gbt_text_compress);
PG_FUNCTION_INFO_V1(gbt_bpchar_compress); PG_FUNCTION_INFO_V1(gbt_bpchar_compress);
PG_FUNCTION_INFO_V1(gbt_text_union); PG_FUNCTION_INFO_V1(gbt_text_union);
@ -163,10 +161,9 @@ static gbtree_vinfo bptinfo =
/************************************************** /**************************************************
* Text ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_text_compress(PG_FUNCTION_ARGS) gbt_text_compress(PG_FUNCTION_ARGS)
{ {
@ -187,8 +184,6 @@ gbt_bpchar_compress(PG_FUNCTION_ARGS)
return gbt_text_compress(fcinfo); return gbt_text_compress(fcinfo);
} }
Datum Datum
gbt_text_consistent(PG_FUNCTION_ARGS) gbt_text_consistent(PG_FUNCTION_ARGS)
{ {
@ -216,7 +211,6 @@ gbt_text_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval); PG_RETURN_BOOL(retval);
} }
Datum Datum
gbt_bpchar_consistent(PG_FUNCTION_ARGS) gbt_bpchar_consistent(PG_FUNCTION_ARGS)
{ {
@ -243,7 +237,6 @@ gbt_bpchar_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval); PG_RETURN_BOOL(retval);
} }
Datum Datum
gbt_text_union(PG_FUNCTION_ARGS) gbt_text_union(PG_FUNCTION_ARGS)
{ {
@ -254,7 +247,6 @@ gbt_text_union(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo)); &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_text_picksplit(PG_FUNCTION_ARGS) gbt_text_picksplit(PG_FUNCTION_ARGS)
{ {
@ -277,7 +269,6 @@ gbt_text_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result); PG_RETURN_POINTER(result);
} }
Datum Datum
gbt_text_penalty(PG_FUNCTION_ARGS) gbt_text_penalty(PG_FUNCTION_ARGS)
{ {

View File

@ -15,9 +15,7 @@ typedef struct
TimeADT upper; TimeADT upper;
} timeKEY; } timeKEY;
/* /* GiST support functions */
** time ops
*/
PG_FUNCTION_INFO_V1(gbt_time_compress); PG_FUNCTION_INFO_V1(gbt_time_compress);
PG_FUNCTION_INFO_V1(gbt_timetz_compress); PG_FUNCTION_INFO_V1(gbt_timetz_compress);
PG_FUNCTION_INFO_V1(gbt_time_fetch); PG_FUNCTION_INFO_V1(gbt_time_fetch);
@ -92,8 +90,6 @@ gbt_timelt(const void *a, const void *b, FmgrInfo *flinfo)
TimeADTGetDatumFast(*bb))); TimeADTGetDatumFast(*bb)));
} }
static int static int
gbt_timekey_cmp(const void *a, const void *b, FmgrInfo *flinfo) 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 Datum
gbt_time_compress(PG_FUNCTION_ARGS) gbt_time_compress(PG_FUNCTION_ARGS)
{ {
@ -163,7 +157,6 @@ gbt_time_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_compress(entry, &tinfo)); PG_RETURN_POINTER(gbt_num_compress(entry, &tinfo));
} }
Datum Datum
gbt_timetz_compress(PG_FUNCTION_ARGS) gbt_timetz_compress(PG_FUNCTION_ARGS)
{ {
@ -262,7 +255,6 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_time_union(PG_FUNCTION_ARGS) 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)); PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
} }
Datum Datum
gbt_time_penalty(PG_FUNCTION_ARGS) gbt_time_penalty(PG_FUNCTION_ARGS)
{ {
@ -313,7 +304,6 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result); PG_RETURN_POINTER(result);
} }
Datum Datum
gbt_time_picksplit(PG_FUNCTION_ARGS) gbt_time_picksplit(PG_FUNCTION_ARGS)
{ {

View File

@ -17,9 +17,7 @@ typedef struct
Timestamp upper; Timestamp upper;
} tsKEY; } tsKEY;
/* /* GiST support functions */
** timestamp ops
*/
PG_FUNCTION_INFO_V1(gbt_ts_compress); PG_FUNCTION_INFO_V1(gbt_ts_compress);
PG_FUNCTION_INFO_V1(gbt_tstz_compress); PG_FUNCTION_INFO_V1(gbt_tstz_compress);
PG_FUNCTION_INFO_V1(gbt_ts_fetch); PG_FUNCTION_INFO_V1(gbt_ts_fetch);
@ -40,6 +38,8 @@ PG_FUNCTION_INFO_V1(gbt_ts_same);
#endif #endif
/* define for comparison */
static bool static bool
gbt_tsgt(const void *a, const void *b, FmgrInfo *flinfo) 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))); TimestampGetDatumFast(*bb)));
} }
static int static int
gbt_tskey_cmp(const void *a, const void *b, FmgrInfo *flinfo) 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)); return fabs(INTERVAL_TO_SEC(i));
} }
static const gbtree_ninfo tinfo = static const gbtree_ninfo tinfo =
{ {
gbt_t_ts, gbt_t_ts,
@ -190,12 +188,10 @@ tstz_dist(PG_FUNCTION_ARGS)
PG_RETURN_INTERVAL_P(abs_interval(r)); PG_RETURN_INTERVAL_P(abs_interval(r));
} }
/************************************************** /**************************************************
* timestamp ops * GiST support functions
**************************************************/ **************************************************/
static inline Timestamp static inline Timestamp
tstz_to_ts_gmt(TimestampTz ts) tstz_to_ts_gmt(TimestampTz ts)
{ {
@ -212,7 +208,6 @@ gbt_ts_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_compress(entry, &tinfo)); PG_RETURN_POINTER(gbt_num_compress(entry, &tinfo));
} }
Datum Datum
gbt_tstz_compress(PG_FUNCTION_ARGS) gbt_tstz_compress(PG_FUNCTION_ARGS)
{ {

View File

@ -15,9 +15,7 @@ typedef struct
} uuidKEY; } uuidKEY;
/* /* GiST support functions */
* UUID ops
*/
PG_FUNCTION_INFO_V1(gbt_uuid_compress); PG_FUNCTION_INFO_V1(gbt_uuid_compress);
PG_FUNCTION_INFO_V1(gbt_uuid_fetch); PG_FUNCTION_INFO_V1(gbt_uuid_fetch);
PG_FUNCTION_INFO_V1(gbt_uuid_union); PG_FUNCTION_INFO_V1(gbt_uuid_union);
@ -93,10 +91,9 @@ static const gbtree_ninfo tinfo =
/************************************************** /**************************************************
* uuid ops * GiST support functions
**************************************************/ **************************************************/
Datum Datum
gbt_uuid_compress(PG_FUNCTION_ARGS) gbt_uuid_compress(PG_FUNCTION_ARGS)
{ {