Commit 1511521a authored by Tom Lane's avatar Tom Lane

Minor cleanup of function declarations for BRIN.

Get rid of PG_FUNCTION_INFO_V1() macros, which are quite inappropriate
for built-in functions (possibly leftovers from testing as a loadable
module?).  Also, fix gratuitous inconsistency between SQL-level and
C-level names of the minmax support functions.
parent b52cb469
...@@ -60,8 +60,6 @@ typedef struct BrinOpaque ...@@ -60,8 +60,6 @@ typedef struct BrinOpaque
BrinDesc *bo_bdesc; BrinDesc *bo_bdesc;
} BrinOpaque; } BrinOpaque;
PG_FUNCTION_INFO_V1(brin_summarize_new_values);
static BrinBuildState *initialize_brin_buildstate(Relation idxRel, static BrinBuildState *initialize_brin_buildstate(Relation idxRel,
BrinRevmap *revmap, BlockNumber pagesPerRange); BrinRevmap *revmap, BlockNumber pagesPerRange);
static void terminate_brin_buildstate(BrinBuildState *state); static void terminate_brin_buildstate(BrinBuildState *state);
......
...@@ -36,23 +36,18 @@ ...@@ -36,23 +36,18 @@
*/ */
#define PROCNUM_BASE 11 #define PROCNUM_BASE 11
static FmgrInfo *minmax_get_procinfo(BrinDesc *bdesc, uint16 attno,
uint16 procnum);
PG_FUNCTION_INFO_V1(minmaxOpcInfo);
PG_FUNCTION_INFO_V1(minmaxAddValue);
PG_FUNCTION_INFO_V1(minmaxConsistent);
PG_FUNCTION_INFO_V1(minmaxUnion);
typedef struct MinmaxOpaque typedef struct MinmaxOpaque
{ {
FmgrInfo operators[MINMAX_NUM_PROCNUMS]; FmgrInfo operators[MINMAX_NUM_PROCNUMS];
bool inited[MINMAX_NUM_PROCNUMS]; bool inited[MINMAX_NUM_PROCNUMS];
} MinmaxOpaque; } MinmaxOpaque;
static FmgrInfo *minmax_get_procinfo(BrinDesc *bdesc, uint16 attno,
uint16 procnum);
Datum Datum
minmaxOpcInfo(PG_FUNCTION_ARGS) brin_minmax_opcinfo(PG_FUNCTION_ARGS)
{ {
Oid typoid = PG_GETARG_OID(0); Oid typoid = PG_GETARG_OID(0);
BrinOpcInfo *result; BrinOpcInfo *result;
...@@ -81,7 +76,7 @@ minmaxOpcInfo(PG_FUNCTION_ARGS) ...@@ -81,7 +76,7 @@ minmaxOpcInfo(PG_FUNCTION_ARGS)
* return false and do not modify in this case. * return false and do not modify in this case.
*/ */
Datum Datum
minmaxAddValue(PG_FUNCTION_ARGS) brin_minmax_add_value(PG_FUNCTION_ARGS)
{ {
BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0); BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0);
BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1); BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1);
...@@ -159,7 +154,7 @@ minmaxAddValue(PG_FUNCTION_ARGS) ...@@ -159,7 +154,7 @@ minmaxAddValue(PG_FUNCTION_ARGS)
* values. Return true if so, false otherwise. * values. Return true if so, false otherwise.
*/ */
Datum Datum
minmaxConsistent(PG_FUNCTION_ARGS) brin_minmax_consistent(PG_FUNCTION_ARGS)
{ {
BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0); BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0);
BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1); BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1);
...@@ -249,7 +244,7 @@ minmaxConsistent(PG_FUNCTION_ARGS) ...@@ -249,7 +244,7 @@ minmaxConsistent(PG_FUNCTION_ARGS)
* values contained in both. The second one is untouched. * values contained in both. The second one is untouched.
*/ */
Datum Datum
minmaxUnion(PG_FUNCTION_ARGS) brin_minmax_union(PG_FUNCTION_ARGS)
{ {
BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0); BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0);
BrinValues *col_a = (BrinValues *) PG_GETARG_POINTER(1); BrinValues *col_a = (BrinValues *) PG_GETARG_POINTER(1);
......
...@@ -83,5 +83,12 @@ typedef struct BrinDesc ...@@ -83,5 +83,12 @@ typedef struct BrinDesc
/* brin.c */ /* brin.c */
extern BrinDesc *brin_build_desc(Relation rel); extern BrinDesc *brin_build_desc(Relation rel);
extern void brin_free_desc(BrinDesc *bdesc); extern void brin_free_desc(BrinDesc *bdesc);
extern Datum brin_summarize_new_values(PG_FUNCTION_ARGS);
/* brin_minmax.c */
extern Datum brin_minmax_opcinfo(PG_FUNCTION_ARGS);
extern Datum brin_minmax_add_value(PG_FUNCTION_ARGS);
extern Datum brin_minmax_consistent(PG_FUNCTION_ARGS);
extern Datum brin_minmax_union(PG_FUNCTION_ARGS);
#endif /* BRIN_INTERNAL_H */ #endif /* BRIN_INTERNAL_H */
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 201411281 #define CATALOG_VERSION_NO 201412021
#endif #endif
...@@ -4118,13 +4118,13 @@ DATA(insert OID = 2748 ( arraycontains PGNSP PGUID 12 1 0 0 0 f f f f t f i ...@@ -4118,13 +4118,13 @@ DATA(insert OID = 2748 ( arraycontains PGNSP PGUID 12 1 0 0 0 f f f f t f i
DATA(insert OID = 2749 ( arraycontained PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ arraycontained _null_ _null_ _null_ )); DATA(insert OID = 2749 ( arraycontained PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ arraycontained _null_ _null_ _null_ ));
/* BRIN minmax */ /* BRIN minmax */
DATA(insert OID = 3383 ( brin_minmax_opcinfo PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ minmaxOpcInfo _null_ _null_ _null_ )); DATA(insert OID = 3383 ( brin_minmax_opcinfo PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ brin_minmax_opcinfo _null_ _null_ _null_ ));
DESCR("BRIN minmax support"); DESCR("BRIN minmax support");
DATA(insert OID = 3384 ( brin_minmax_add_value PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 16 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ minmaxAddValue _null_ _null_ _null_ )); DATA(insert OID = 3384 ( brin_minmax_add_value PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 16 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ brin_minmax_add_value _null_ _null_ _null_ ));
DESCR("BRIN minmax support"); DESCR("BRIN minmax support");
DATA(insert OID = 3385 ( brin_minmax_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 16 "2281 2281 2281" _null_ _null_ _null_ _null_ minmaxConsistent _null_ _null_ _null_ )); DATA(insert OID = 3385 ( brin_minmax_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 16 "2281 2281 2281" _null_ _null_ _null_ _null_ brin_minmax_consistent _null_ _null_ _null_ ));
DESCR("BRIN minmax support"); DESCR("BRIN minmax support");
DATA(insert OID = 3386 ( brin_minmax_union PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 16 "2281 2281 2281" _null_ _null_ _null_ _null_ minmaxUnion _null_ _null_ _null_ )); DATA(insert OID = 3386 ( brin_minmax_union PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 16 "2281 2281 2281" _null_ _null_ _null_ _null_ brin_minmax_union _null_ _null_ _null_ ));
DESCR("BRIN minmax support"); DESCR("BRIN minmax support");
/* userlock replacements */ /* userlock replacements */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment