Moved _PG_init

This commit is contained in:
Andrew Kane
2023-07-16 20:03:34 -07:00
parent ad8df27fbb
commit 6e8746277e
4 changed files with 16 additions and 4 deletions

View File

@@ -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",

View File

@@ -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 */

View File

@@ -2,7 +2,9 @@
#include <math.h>
#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
*/

View File

@@ -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!) */