You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
init pg error error: CREATE INDEX CONCURRENTLY cannot run inside a transaction block
at eval (webpack-internal:///(api)/../../node_modules/.pnpm/registry.npmmirror.com+pg-pool@3.6.1_pg@8.10.0/node_modules/pg-pool/index.js:45:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async initPg (webpack-internal:///(api)/../../packages/service/common/vectorStore/pg/controller.ts:23:9)
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
The latest code (main branch, 20240102)
Source code startup throws the following error:
i```
nit pg error error: CREATE INDEX CONCURRENTLY cannot run inside a transaction block
at eval (webpack-internal:///(api)/../../node_modules/.pnpm/registry.npmmirror.com+pg-pool@3.6.1_pg@8.10.0/node_modules/pg-pool/index .js:45:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async initPg (webpack-internal:///(api)/../../packages/service/common/vectorStore/pg/controller.ts:23:9)
Locate the problem with the file: FastGPT\packages\service\common\vectorStore\pg\controller.ts, and separate the created index separately:
export async function initPg() {
try {
await connectPg();
await PgClient.query(CREATE EXTENSION IF NOT EXISTS vector; CREATE TABLE IF NOT EXISTS ${PgDatasetTableName} ( id BIGSERIAL PRIMARY KEY, vector VECTOR(1536) NOT NULL, team_id VARCHAR(50) NOT NULL, tmb_id VARCHAR(50) NOT NULL, dataset_id VARCHAR(50) NOT NULL, collection_id VARCHAR(50) NOT NULL, data_id VARCHAR(50) NOT NULL, createTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ););
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');
最新代码(main分支,20240102)
源码启动抛出以下错误:
定位到是文件:FastGPT\packages\service\common\vectorStore\pg\controller.ts的问题,把创建index单独分离出来:
The text was updated successfully, but these errors were encountered: