mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
fix: init pg error error: CREATE INDEX CONCURRENTLY cannot run inside a transaction block (#684)
Co-authored-by: weifj <“weifj@tuyuansu.com.cn”>
This commit is contained in:
@@ -22,7 +22,11 @@ export async function initPg() {
|
|||||||
data_id VARCHAR(50) NOT NULL,
|
data_id VARCHAR(50) NOT NULL,
|
||||||
createTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
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');
|
console.log('init pg successful');
|
||||||
|
Reference in New Issue
Block a user