psycopg2.errors.UndefinedTable: relation “xxxx“ does not exist

psycopg2.errors.UndefinedTable: relation “xxxx” does not exist
python连接PostgreSQL之后,查找操作报错如题,原因是数据库表名是有大写字母,需要在表名上加入双引号,因为PostgreSQL大小写不敏感。比如:‘select * from “Xxxx”’

docker logs docker-api-1 Running migrations 2025-03-08 03:22:24.919 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. /app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d' """ 2025-03-08 03:22:31.355 INFO [MainThread] [_client.py:1038] - HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK" Preparing database migration... Database migration skipped [2025-03-08 03:22:38 +0000] [1] [INFO] Starting gunicorn 23.0.0 [2025-03-08 03:22:38 +0000] [1] [INFO] Listening at: http://0.0.0.0:5001 (1) [2025-03-08 03:22:38 +0000] [1] [INFO] Using worker: gevent [2025-03-08 03:22:38 +0000] [44] [INFO] Booting worker with pid: 44 2025-03-08 03:22:41.069 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. 2025-03-08 03:22:44.031 INFO [MainThread] [_client.py:1038] - HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK" 2025-03-08 03:23:34.125 ERROR [Dummy-1] [app.py:875] - Exception on /console/api/setup [GET] Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context self.dialect.do_execute( File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute cursor.execute(statement, parameters) psycopg2.errors.UndefinedTable: relation "dify_setups" does not exist LINE 2: FROM dify_setups ^ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request return
最新发布
03-09
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值