diff --git a/src/vector.c b/src/vector.c index d232a23..fa5cbca 100644 --- a/src/vector.c +++ b/src/vector.c @@ -822,7 +822,7 @@ vector_accum(PG_FUNCTION_ARGS) if (newarr) { for (int i = 0; i < dim; i++) - statedatums[i + 1] = Float8GetDatumFast(x[i]); + statedatums[i + 1] = Float8GetDatumFast((double) x[i]); } else { diff --git a/src/vector.h b/src/vector.h index 3e41130..93aeb6a 100644 --- a/src/vector.h +++ b/src/vector.h @@ -3,6 +3,10 @@ #include "postgres.h" +#if PG_VERSION_NUM >= 160000 +#include "varatt.h" +#endif + #define VECTOR_MAX_DIM 16000 #define VECTOR_SIZE(_dim) (offsetof(Vector, x) + sizeof(float)*(_dim))