mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-01 18:21:16 +08:00
Moved _PG_init
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 */
|
||||
|
||||
11
src/vector.c
11
src/vector.c
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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!) */
|
||||
|
||||
Reference in New Issue
Block a user