Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

public.records表不存在 #11

Open
harold-yh opened this issue Nov 19, 2024 · 3 comments
Open

public.records表不存在 #11

harold-yh opened this issue Nov 19, 2024 · 3 comments

Comments

@harold-yh
Copy link

建表语句里引用了public.records,但是这个表不存在,导致没有建表。
select
sip_call_id as "CallID",
to_char(min(create_time),'HH24:MI:SS') as "startTime",
to_char(min(create_time),'YYYY-MM-DD') as "day",
to_char(max(create_time),'HH24:MI:SS') as "stopTime",
to_char(max(create_time) - min(create_time),'HH24:MI:SS') as "duration",
min(from_user) as "caller",
min(to_user) as "callee",
count()::int as "msgTotal",
min(user_agent) as "UA",
max(response_code)::int as "finalCode",
string_agg(DISTINCT CASE WHEN response_code BETWEEN 170 AND 190 THEN response_code::text END, ',') AS "tempCode"
from
public.records
where
create_time >= '2024-11-19 15:43:36' and create_time <= '2024-11-19 15:53:36'
group by sip_call_id
having count(
) >= 1
order by "startTime" desc
limit 10

/app/node_modules/.pnpm/[email protected][email protected]/node_modules/pg-pool/index.js:45
Error.captureStackTrace(err)
^

error: relation "public.records" does not exist
at /app/node_modules/.pnpm/[email protected][email protected]/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async queryRecord (file:///app/db.mjs:90:17)
at async file:///app/app.mjs:30:16 {
length: 114,
severity: 'ERROR',
code: '42P01',
detail: undefined,
hint: undefined,
position: '637',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '1428',
routine: 'parserOpenTable'
}

Node.js v22.11.0

@wangduanduan
Copy link
Owner

hep-connect没有部署吧, 这个服务负责建表

@wangduanduan
Copy link
Owner

hep-connect将消息写入数据库, hep-connect部署文档参考 https://github.com/wangduanduan/hep-connect

@wangduanduan
Copy link
Owner

hep-connect要先启动

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants