diff --git a/src/hnswbuild.c b/src/hnswbuild.c index ab32b1c..fe259dc 100644 --- a/src/hnswbuild.c +++ b/src/hnswbuild.c @@ -678,12 +678,8 @@ HnswSharedMemoryAlloc(Size size, void *state) static int GetMaxDimensions(Relation index) { - Oid typid = TupleDescAttr(index->rd_att, 0)->atttypid; FmgrInfo *procinfo = HnswOptionalProcInfo(index, HNSW_MAX_DIMS_PROC); - if (typid == VARBITOID) - elog(ERROR, "type not supported for hnsw index"); - if (procinfo == NULL) return HNSW_MAX_DIM; @@ -707,6 +703,9 @@ InitBuildState(HnswBuildState * buildstate, Relation heap, Relation index, Index buildstate->efConstruction = HnswGetEfConstruction(index); buildstate->dimensions = TupleDescAttr(index->rd_att, 0)->atttypmod; + if (TupleDescAttr(index->rd_att, 0)->atttypid == VARBITOID) + elog(ERROR, "type not supported for hnsw index"); + maxDimensions = GetMaxDimensions(index); /* Require column to have dimensions to be indexed */