58 Datum (*leftmostvalue) (
void),
68 bool *ptr_partialmatch;
71 ptr_partialmatch = *partialmatch = (
bool *)
palloc(
sizeof(
bool));
72 *ptr_partialmatch =
false;
75 data->strategy = strategy;
77 data->is_varlena = is_varlena;
78 data->typecmp = typecmp;
86 entries[0] = leftmostvalue();
87 *ptr_partialmatch =
true;
91 *ptr_partialmatch =
true;
97 elog(
ERROR,
"unrecognized strategy number: %d", strategy);
125 switch (
data->strategy)
165 elog(
ERROR,
"unrecognized strategy number: %d",
185 #define GIN_SUPPORT(type, is_varlena, leftmostvalue, typecmp) \
186 PG_FUNCTION_INFO_V1(gin_extract_value_##type); \
188 gin_extract_value_##type(PG_FUNCTION_ARGS) \
190 return gin_btree_extract_value(fcinfo, is_varlena); \
192 PG_FUNCTION_INFO_V1(gin_extract_query_##type); \
194 gin_extract_query_##type(PG_FUNCTION_ARGS) \
196 return gin_btree_extract_query(fcinfo, \
197 is_varlena, leftmostvalue, typecmp); \
199 PG_FUNCTION_INFO_V1(gin_compare_prefix_##type); \
201 gin_compare_prefix_##type(PG_FUNCTION_ARGS) \
203 return gin_btree_compare_prefix(fcinfo); \
289 v->
zone = -24 * 3600;
396 #define NUMERIC_IS_LEFTMOST(x) ((x) == NULL)
443 #define ENUM_IS_LEFTMOST(x) ((x) == InvalidOid)
Datum numeric_cmp(PG_FUNCTION_ARGS)
Datum timestamp_cmp(PG_FUNCTION_ARGS)
Datum interval_cmp(PG_FUNCTION_ARGS)
static Datum leftmostvalue_oid(void)
static Datum gin_btree_extract_query(FunctionCallInfo fcinfo, bool is_varlena, Datum(*leftmostvalue)(void), Datum(*typecmp)(FunctionCallInfo))
Datum gin_numeric_cmp(PG_FUNCTION_ARGS)
static Datum leftmostvalue_timestamp(void)
#define GIN_SUPPORT(type, is_varlena, leftmostvalue, typecmp)
static Datum leftmostvalue_int4(void)
static Datum leftmostvalue_varbit(void)
static Datum leftmostvalue_float8(void)
static Datum leftmostvalue_time(void)
static Datum leftmostvalue_int2(void)
Datum gin_enum_cmp(PG_FUNCTION_ARGS)
static Datum leftmostvalue_macaddr8(void)
static Datum leftmostvalue_text(void)
struct QueryInfo QueryInfo
static Datum leftmostvalue_enum(void)
static Datum leftmostvalue_bool(void)
#define NUMERIC_IS_LEFTMOST(x)
static Datum leftmostvalue_interval(void)
static Datum leftmostvalue_float4(void)
static Datum leftmostvalue_name(void)
static Datum leftmostvalue_inet(void)
static Datum leftmostvalue_char(void)
static Datum leftmostvalue_uuid(void)
static Datum leftmostvalue_macaddr(void)
Datum gin_btree_consistent(PG_FUNCTION_ARGS)
static Datum leftmostvalue_timetz(void)
#define ENUM_IS_LEFTMOST(x)
static Datum leftmostvalue_money(void)
static Datum leftmostvalue_numeric(void)
static Datum gin_btree_compare_prefix(FunctionCallInfo fcinfo)
static Datum gin_btree_extract_value(FunctionCallInfo fcinfo, bool is_varlena)
static Datum leftmostvalue_int8(void)
static Datum leftmostvalue_date(void)
PG_FUNCTION_INFO_V1(gin_btree_consistent)
static Datum leftmostvalue_bit(void)
Datum cash_cmp(PG_FUNCTION_ARGS)
#define INTERVAL_NOBEGIN(i)
Datum date_cmp(PG_FUNCTION_ARGS)
Datum time_cmp(PG_FUNCTION_ARGS)
Datum timetz_cmp(PG_FUNCTION_ARGS)
static Datum DateADTGetDatum(DateADT X)
static Datum TimeTzADTPGetDatum(const TimeTzADT *X)
static Datum TimeADTGetDatum(TimeADT X)
static void PGresult * res
Datum enum_cmp(PG_FUNCTION_ARGS)
Datum btfloat4cmp(PG_FUNCTION_ARGS)
Datum btfloat8cmp(PG_FUNCTION_ARGS)
static float4 get_float4_infinity(void)
static float8 get_float8_infinity(void)
Datum Int64GetDatum(int64 X)
Datum Float8GetDatum(float8 X)
Datum CallerFInfoFunctionCall2(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_POINTER(n)
#define DirectFunctionCall1(func, arg1)
#define PG_GETARG_DATUM(n)
struct FunctionCallInfoBaseData * FunctionCallInfo
#define PG_GETARG_UINT16(n)
#define PG_DETOAST_DATUM(datum)
#define PG_RETURN_INT32(x)
#define DirectFunctionCall3(func, arg1, arg2, arg3)
#define PG_RETURN_POINTER(x)
#define PG_GET_COLLATION()
#define PG_RETURN_BOOL(x)
Datum macaddr8_cmp(PG_FUNCTION_ARGS)
Datum macaddr_cmp(PG_FUNCTION_ARGS)
void * palloc0(Size size)
Datum btnamecmp(PG_FUNCTION_ARGS)
Datum btint4cmp(PG_FUNCTION_ARGS)
Datum btboolcmp(PG_FUNCTION_ARGS)
Datum btint2cmp(PG_FUNCTION_ARGS)
Datum btoidcmp(PG_FUNCTION_ARGS)
Datum btcharcmp(PG_FUNCTION_ARGS)
Datum btint8cmp(PG_FUNCTION_ARGS)
Datum inet_in(PG_FUNCTION_ARGS)
Datum network_cmp(PG_FUNCTION_ARGS)
struct NumericData * Numeric
static Datum NumericGetDatum(Numeric X)
static Datum PointerGetDatum(const void *X)
static Datum Float4GetDatum(float4 X)
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum NameGetDatum(const NameData *X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
static int32 DatumGetInt32(Datum X)
static Datum CharGetDatum(char X)
static int cmp(const chr *x, const chr *y, size_t len)
#define BTGreaterStrategyNumber
#define BTLessStrategyNumber
#define BTEqualStrategyNumber
#define BTLessEqualStrategyNumber
#define BTGreaterEqualStrategyNumber
Datum(* typecmp)(FunctionCallInfo)
static Datum MacaddrPGetDatum(const macaddr *X)
static Datum Macaddr8PGetDatum(const macaddr8 *X)
static Datum TimestampGetDatum(Timestamp X)
static Datum IntervalPGetDatum(const Interval *X)
Datum uuid_cmp(PG_FUNCTION_ARGS)
static Datum UUIDPGetDatum(const pg_uuid_t *X)
Datum bitcmp(PG_FUNCTION_ARGS)
Datum bit(PG_FUNCTION_ARGS)
Datum varbit(PG_FUNCTION_ARGS)
Datum bit_in(PG_FUNCTION_ARGS)
Datum varbit_in(PG_FUNCTION_ARGS)
Datum bpchar(PG_FUNCTION_ARGS)
Datum bpcharcmp(PG_FUNCTION_ARGS)
Datum byteacmp(PG_FUNCTION_ARGS)
text * cstring_to_text_with_len(const char *s, int len)
Datum bttextcmp(PG_FUNCTION_ARGS)