PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
btree_gist.c
Go to the documentation of this file.
1/*
2 * contrib/btree_gist/btree_gist.c
3 */
4#include "postgres.h"
5
6#include "access/cmptype.h"
7#include "access/stratnum.h"
8#include "utils/builtins.h"
9
11 .name = "btree_gist",
12 .version = PG_VERSION
13);
14
19
20/**************************************************
21 * In/Out for keys
22 **************************************************/
23
24
27{
28 Oid typioparam = PG_GETARG_OID(1);
29
31 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
32 errmsg("cannot accept a value of type %s",
33 format_type_extended(typioparam, -1,
35
36 PG_RETURN_VOID(); /* keep compiler quiet */
37}
38
41{
42 /* Sadly, we do not receive any indication of the specific type */
44 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
45 errmsg("cannot display a value of type %s", "gbtreekey?")));
46
47 PG_RETURN_VOID(); /* keep compiler quiet */
48}
49
50
51/*
52** GiST DeCompress methods
53** do not do anything.
54*/
57{
59}
60
61/*
62 * Returns the btree number for supported operators, otherwise invalid.
63 */
66{
67 CompareType cmptype = PG_GETARG_INT32(0);
68
69 switch (cmptype)
70 {
71 case COMPARE_EQ:
73 case COMPARE_LT:
75 case COMPARE_LE:
77 case COMPARE_GT:
79 case COMPARE_GE:
81 default:
83 }
84}
Datum gbt_decompress(PG_FUNCTION_ARGS)
Definition: btree_gist.c:56
Datum gbtreekey_out(PG_FUNCTION_ARGS)
Definition: btree_gist.c:40
PG_MODULE_MAGIC_EXT(.name="btree_gist",.version=PG_VERSION)
PG_FUNCTION_INFO_V1(gbt_decompress)
Datum gist_stratnum_btree(PG_FUNCTION_ARGS)
Definition: btree_gist.c:65
Datum gbtreekey_in(PG_FUNCTION_ARGS)
Definition: btree_gist.c:26
#define FORMAT_TYPE_ALLOW_INVALID
Definition: builtins.h:125
CompareType
Definition: cmptype.h:32
@ COMPARE_LE
Definition: cmptype.h:35
@ COMPARE_GT
Definition: cmptype.h:38
@ COMPARE_EQ
Definition: cmptype.h:36
@ COMPARE_GE
Definition: cmptype.h:37
@ COMPARE_LT
Definition: cmptype.h:34
int errcode(int sqlerrcode)
Definition: elog.c:853
int errmsg(const char *fmt,...)
Definition: elog.c:1070
#define ERROR
Definition: elog.h:39
#define ereport(elevel,...)
Definition: elog.h:149
#define PG_RETURN_VOID()
Definition: fmgr.h:349
#define PG_GETARG_OID(n)
Definition: fmgr.h:275
#define PG_GETARG_POINTER(n)
Definition: fmgr.h:276
#define PG_GETARG_INT32(n)
Definition: fmgr.h:269
#define PG_RETURN_UINT16(x)
Definition: fmgr.h:357
#define PG_RETURN_POINTER(x)
Definition: fmgr.h:361
#define PG_FUNCTION_ARGS
Definition: fmgr.h:193
char * format_type_extended(Oid type_oid, int32 typemod, bits16 flags)
Definition: format_type.c:112
uintptr_t Datum
Definition: postgres.h:69
unsigned int Oid
Definition: postgres_ext.h:30
#define BTGreaterStrategyNumber
Definition: stratnum.h:33
#define InvalidStrategy
Definition: stratnum.h:24
#define BTLessStrategyNumber
Definition: stratnum.h:29
#define BTEqualStrategyNumber
Definition: stratnum.h:31
#define BTLessEqualStrategyNumber
Definition: stratnum.h:30
#define BTGreaterEqualStrategyNumber
Definition: stratnum.h:32
const char * name