diff --git a/src/ivfflat.c b/src/ivfflat.c index 62a4ea2..3753a74 100644 --- a/src/ivfflat.c +++ b/src/ivfflat.c @@ -20,7 +20,7 @@ static relopt_kind ivfflat_relopt_kind; * Initialize index options and variables */ void -_PG_init(void) +IvfflatInit(void) { ivfflat_relopt_kind = add_reloption_kind(); add_int_reloption(ivfflat_relopt_kind, "lists", "Number of inverted lists", diff --git a/src/ivfflat.h b/src/ivfflat.h index 92912c9..0e0e6f4 100644 --- a/src/ivfflat.h +++ b/src/ivfflat.h @@ -84,9 +84,6 @@ /* Variables */ extern int ivfflat_probes; -/* Exported functions */ -PGDLLEXPORT void _PG_init(void); - typedef struct VectorArrayData { int length; @@ -288,6 +285,7 @@ void IvfflatAppendPage(Relation index, Buffer *buf, Page *page, GenericXLogStat Buffer IvfflatNewBuffer(Relation index, ForkNumber forkNum); void IvfflatInitPage(Buffer buf, Page page); void IvfflatInitRegisterPage(Relation index, Buffer *buf, Page *page, GenericXLogState **state); +void IvfflatInit(void); PGDLLEXPORT void IvfflatParallelBuildMain(dsm_segment *seg, shm_toc *toc); /* Index access methods */ diff --git a/src/vector.c b/src/vector.c index e9a151e..e76d43f 100644 --- a/src/vector.c +++ b/src/vector.c @@ -2,7 +2,9 @@ #include +#include "ivfflat.h" #include "vector.h" + #include "fmgr.h" #include "catalog/pg_type.h" #include "lib/stringinfo.h" @@ -29,6 +31,15 @@ PG_MODULE_MAGIC; +/* + * Initialize index options and variables + */ +void +_PG_init(void) +{ + IvfflatInit(); +} + /* * Ensure same dimensions */ diff --git a/src/vector.h b/src/vector.h index 93aeb6a..292be98 100644 --- a/src/vector.h +++ b/src/vector.h @@ -14,6 +14,9 @@ #define PG_GETARG_VECTOR_P(x) DatumGetVector(PG_GETARG_DATUM(x)) #define PG_RETURN_VECTOR_P(x) PG_RETURN_POINTER(x) +/* Exported functions */ +PGDLLEXPORT void _PG_init(void); + typedef struct Vector { int32 vl_len_; /* varlena header (do not touch directly!) */