PostgreSQL Source Code  git master
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/stratnum.h"
7 #include "utils/builtins.h"
8 
10 
15 
16 /**************************************************
17  * In/Out for keys
18  **************************************************/
19 
20 
21 Datum
23 {
24  Oid typioparam = PG_GETARG_OID(1);
25 
26  ereport(ERROR,
27  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
28  errmsg("cannot accept a value of type %s",
29  format_type_extended(typioparam, -1,
31 
32  PG_RETURN_VOID(); /* keep compiler quiet */
33 }
34 
35 Datum
37 {
38  /* Sadly, we do not receive any indication of the specific type */
39  ereport(ERROR,
40  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
41  errmsg("cannot display a value of type %s", "gbtreekey?")));
42 
43  PG_RETURN_VOID(); /* keep compiler quiet */
44 }
45 
46 
47 /*
48 ** GiST DeCompress methods
49 ** do not do anything.
50 */
51 Datum
53 {
55 }
56 
57 /*
58  * Returns the btree number for supported operators, otherwise invalid.
59  */
60 Datum
62 {
64 
65  switch (strat)
66  {
77  default:
79  }
80 }
Datum gbt_decompress(PG_FUNCTION_ARGS)
Definition: btree_gist.c:52
Datum gbtreekey_out(PG_FUNCTION_ARGS)
Definition: btree_gist.c:36
PG_MODULE_MAGIC
Definition: btree_gist.c:9
PG_FUNCTION_INFO_V1(gbt_decompress)
Datum gist_stratnum_btree(PG_FUNCTION_ARGS)
Definition: btree_gist.c:61
Datum gbtreekey_in(PG_FUNCTION_ARGS)
Definition: btree_gist.c:22
#define FORMAT_TYPE_ALLOW_INVALID
Definition: builtins.h:125
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_UINT16(n)
Definition: fmgr.h:272
#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:64
unsigned int Oid
Definition: postgres_ext.h:31
uint16 StrategyNumber
Definition: stratnum.h:22
#define BTGreaterStrategyNumber
Definition: stratnum.h:33
#define RTEqualStrategyNumber
Definition: stratnum.h:68
#define InvalidStrategy
Definition: stratnum.h:24
#define RTLessEqualStrategyNumber
Definition: stratnum.h:71
#define RTGreaterEqualStrategyNumber
Definition: stratnum.h:73
#define RTGreaterStrategyNumber
Definition: stratnum.h:72
#define BTLessStrategyNumber
Definition: stratnum.h:29
#define BTEqualStrategyNumber
Definition: stratnum.h:31
#define BTLessEqualStrategyNumber
Definition: stratnum.h:30
#define BTGreaterEqualStrategyNumber
Definition: stratnum.h:32
#define RTLessStrategyNumber
Definition: stratnum.h:70