Improved warnings check

This commit is contained in:
Andrew Kane
2023-06-09 18:46:26 -07:00
parent f81d863dfd
commit cbec1b3f48
2 changed files with 4 additions and 4 deletions

View File

@@ -212,7 +212,7 @@ ElkanKmeans(Relation index, VectorArray samples, VectorArray centers)
/* Check memory requirements */
/* Add one to error message to ceil */
if (totalSize / 1024 > maintenance_work_mem)
if (totalSize > (Size) maintenance_work_mem * 1024L)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("memory required is %zu MB, maintenance_work_mem is %d MB",