当我尝试连接postgres RDS数据库使用特里诺服务器,使用目录.
我得到这个错误:
trino.exceptions.TrinoUserError: TrinoUserError(type=USER_ERROR, name=AUTOCOMMIT_WRITE_CONFLICT, message="Catalog only supports writes using autocommit: <catalog_name>", query_id=20240103_105150_00001_w6b9p)
字符串
下面是我的Python代码:
from trino.dbapi import connect
from trino.auth import BasicAuthentication
from trino.transaction import IsolationLevel
with connect(
host="localhost",
port=8080,
user="username",
auth=BasicAuthentication("username", "password"),
http_scheme="https",
isolation_level=IsolationLevel.SERIALIZABLE,
verify=False,
catalog="my_catalog_name"
) as conn:
cur = conn.cursor()
cur.execute('INSERT INTO sometable VALUES (4, 5, 6)')
型
这是我目录:
connector.name=postgresql
connection-url=jdbc:postgresql://host:5432/db_name?ssl=true
connection-user=postgres
connection-password=password
型
我希望能解决这个问题!
1条答案
按热度按时间t5zmwmid1#
错误消息表明您正在使用的目录(“my_catalog_name”)仅支持使用自动提交的写入。您需要修改Python代码以在执行SQL语句时使用自动提交。
字符串