mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-02 18:50:56 +08:00
Dropped support for Postgres 11
This commit is contained in:
22
src/vector.c
22
src/vector.c
@@ -3,6 +3,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "catalog/pg_type.h"
|
||||
#include "common/shortest_dec.h"
|
||||
#include "fmgr.h"
|
||||
#include "hnsw.h"
|
||||
#include "ivfflat.h"
|
||||
@@ -11,6 +12,7 @@
|
||||
#include "port.h" /* for strtof() */
|
||||
#include "utils/array.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/float.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/numeric.h"
|
||||
#include "vector.h"
|
||||
@@ -19,13 +21,6 @@
|
||||
#include "varatt.h"
|
||||
#endif
|
||||
|
||||
#if PG_VERSION_NUM >= 120000
|
||||
#include "common/shortest_dec.h"
|
||||
#include "utils/float.h"
|
||||
#else
|
||||
#include <float.h>
|
||||
#endif
|
||||
|
||||
#if PG_VERSION_NUM < 130000
|
||||
#define TYPALIGN_DOUBLE 'd'
|
||||
#define TYPALIGN_INT 'i'
|
||||
@@ -293,15 +288,6 @@ vector_out(PG_FUNCTION_ARGS)
|
||||
char *ptr;
|
||||
int n;
|
||||
|
||||
#if PG_VERSION_NUM < 120000
|
||||
int ndig = FLT_DIG + extra_float_digits;
|
||||
|
||||
if (ndig < 1)
|
||||
ndig = 1;
|
||||
|
||||
#define FLOAT_SHORTEST_DECIMAL_LEN (ndig + 10)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Need:
|
||||
*
|
||||
@@ -325,11 +311,7 @@ vector_out(PG_FUNCTION_ARGS)
|
||||
ptr++;
|
||||
}
|
||||
|
||||
#if PG_VERSION_NUM >= 120000
|
||||
n = float_to_shortest_decimal_bufn(vector->x[i], ptr);
|
||||
#else
|
||||
n = sprintf(ptr, "%.*g", ndig, vector->x[i]);
|
||||
#endif
|
||||
ptr += n;
|
||||
}
|
||||
*ptr = ']';
|
||||
|
||||
Reference in New Issue
Block a user