Commit c766a0ed by leoterry Committed by GitHub

fix: init pg error error: CREATE INDEX CONCURRENTLY cannot run inside a transaction block (#684)

Co-authored-by: weifj <“weifj@tuyuansu.com.cn”>
parent d5b24eca
......@@ -22,7 +22,11 @@ export async function initPg() {
data_id VARCHAR(50) NOT NULL,
createTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX CONCURRENTLY IF NOT EXISTS vector_index ON ${PgDatasetTableName} USING hnsw (vector vector_ip_ops) WITH (m = 32, ef_construction = 64);
`);
await PgClient.query(`
CREATE INDEX CONCURRENTLY IF NOT EXISTS vector_index ON ${PgDatasetTableName}
USING hnsw (vector vector_ip_ops) WITH (m = 32, ef_construction = 64);
`);
console.log('init pg successful');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment