Skip to content

Commit 1511521

Browse files
committed
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.
1 parent b52cb46 commit 1511521

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

src/backend/access/brin/brin.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ typedef struct BrinOpaque
6060
BrinDesc *bo_bdesc;
6161
} BrinOpaque;
6262

63-
PG_FUNCTION_INFO_V1(brin_summarize_new_values);
64-
6563
static BrinBuildState *initialize_brin_buildstate(Relation idxRel,
6664
BrinRevmap *revmap, BlockNumber pagesPerRange);
6765
static void terminate_brin_buildstate(BrinBuildState *state);

src/backend/access/brin/brin_minmax.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,18 @@
3636
*/
3737
#define PROCNUM_BASE 11
3838

39-
static FmgrInfo *minmax_get_procinfo(BrinDesc *bdesc, uint16 attno,
40-
uint16 procnum);
41-
42-
PG_FUNCTION_INFO_V1(minmaxOpcInfo);
43-
PG_FUNCTION_INFO_V1(minmaxAddValue);
44-
PG_FUNCTION_INFO_V1(minmaxConsistent);
45-
PG_FUNCTION_INFO_V1(minmaxUnion);
46-
47-
4839
typedef struct MinmaxOpaque
4940
{
5041
FmgrInfo operators[MINMAX_NUM_PROCNUMS];
5142
bool inited[MINMAX_NUM_PROCNUMS];
5243
} MinmaxOpaque;
5344

45+
static FmgrInfo *minmax_get_procinfo(BrinDesc *bdesc, uint16 attno,
46+
uint16 procnum);
47+
48+
5449
Datum
55-
minmaxOpcInfo(PG_FUNCTION_ARGS)
50+
brin_minmax_opcinfo(PG_FUNCTION_ARGS)
5651
{
5752
Oid typoid = PG_GETARG_OID(0);
5853
BrinOpcInfo *result;
@@ -81,7 +76,7 @@ minmaxOpcInfo(PG_FUNCTION_ARGS)
8176
* return false and do not modify in this case.
8277
*/
8378
Datum
84-
minmaxAddValue(PG_FUNCTION_ARGS)
79+
brin_minmax_add_value(PG_FUNCTION_ARGS)
8580
{
8681
BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0);
8782
BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1);
@@ -159,7 +154,7 @@ minmaxAddValue(PG_FUNCTION_ARGS)
159154
* values. Return true if so, false otherwise.
160155
*/
161156
Datum
162-
minmaxConsistent(PG_FUNCTION_ARGS)
157+
brin_minmax_consistent(PG_FUNCTION_ARGS)
163158
{
164159
BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0);
165160
BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1);
@@ -249,7 +244,7 @@ minmaxConsistent(PG_FUNCTION_ARGS)
249244
* values contained in both. The second one is untouched.
250245
*/
251246
Datum
252-
minmaxUnion(PG_FUNCTION_ARGS)
247+
brin_minmax_union(PG_FUNCTION_ARGS)
253248
{
254249
BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0);
255250
BrinValues *col_a = (BrinValues *) PG_GETARG_POINTER(1);

src/include/access/brin_internal.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,12 @@ typedef struct BrinDesc
8383
/* brin.c */
8484
extern BrinDesc *brin_build_desc(Relation rel);
8585
extern void brin_free_desc(BrinDesc *bdesc);
86+
extern Datum brin_summarize_new_values(PG_FUNCTION_ARGS);
87+
88+
/* brin_minmax.c */
89+
extern Datum brin_minmax_opcinfo(PG_FUNCTION_ARGS);
90+
extern Datum brin_minmax_add_value(PG_FUNCTION_ARGS);
91+
extern Datum brin_minmax_consistent(PG_FUNCTION_ARGS);
92+
extern Datum brin_minmax_union(PG_FUNCTION_ARGS);
8693

8794
#endif /* BRIN_INTERNAL_H */

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 201411281
56+
#define CATALOG_VERSION_NO 201412021
5757

5858
#endif

src/include/catalog/pg_proc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4118,13 +4118,13 @@ DATA(insert OID = 2748 ( arraycontains PGNSP PGUID 12 1 0 0 0 f f f f t f i
41184118
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_ ));
41194119

41204120
/* BRIN minmax */
4121-
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_ ));
4121+
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_ ));
41224122
DESCR("BRIN minmax support");
4123-
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_ ));
4123+
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_ ));
41244124
DESCR("BRIN minmax support");
4125-
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_ ));
4125+
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_ ));
41264126
DESCR("BRIN minmax support");
4127-
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_ ));
4127+
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_ ));
41284128
DESCR("BRIN minmax support");
41294129

41304130
/* userlock replacements */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy