Heroku PostgreSQL 中的“错误:无法在只读事务中执行 TRUNCATE TABLE”

man*_*ore 3 postgresql heroku heroku-postgres

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

我正在尝试TRUNCATE一张桌子。

我正在使用Heroku Postgres.

在此输入图像描述

我试图在用户界面中弄清楚如何更改我的权限或类似的东西以允许不仅运行read-only transactions. 但没有成功。

JAD*_*JAD 6

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

begin;
set transaction read write;

Delete FROM mytable where id > 2130;

COMMIT;  
Run Code Online (Sandbox Code Playgroud)