[用户在YugabyteDB Community Slack上发布的问题]
Postgres提供了一种方法,可以通过更改角色https://www.postgresql.org/docs/11/sql-alterrole.html来设置每个用户的statement_timeout
有一种已知的解决方法可以在连接建立后为其设置statement_timeout,但在角色级别设置它会很有帮助。
YugabyteDB上也有可用的东西吗?
发布于 2021-10-15 11:07:49
这应该已经可以实现了,就像在PostgreSQL中一样。示例:
yugabyte=# ALTER ROLE yugabyte SET statement_timeout = 5000;然后打开另一个shell并尝试这样做:
yugabyte=# select pg_sleep(5);
ERROR: canceling statement due to statement timeout
yugabyte=# select pg_sleep(4);
pg_sleep
----------
(1 row)在2.9.0.0上测试
https://stackoverflow.com/questions/69583803
复制相似问题