gpt4 book ai didi

postgresql - Heroku PostgreSQL 中的 `ERROR: cannot execute TRUNCATE TABLE in a read-only transaction`

转载 作者:行者123 更新时间:2023-12-05 08:50:16 27 4
gpt4 key购买 nike

我在 Heroku PostgreSQL 中收到 ERROR: cannot execute TRUNCATE TABLE in a read-only transaction。我该如何解决?

我正在尝试TRUNCATE 一个表。

我正在使用 Heroku Postgres

enter image description here

我试图在 UI 中弄清楚如何更改我的权限或类似的东西以允许不仅运行只读事务。但没有成功。

最佳答案

这是目前可行的,您必须在创建数据剪辑时将事务设置为“READ WRITE”。这是一个例子:

begin;
set transaction read write;

Delete FROM mytable where id > 2130;

COMMIT;

关于postgresql - Heroku PostgreSQL 中的 `ERROR: cannot execute TRUNCATE TABLE in a read-only transaction`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62351724/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com