php - postgresql最大执行时间

dan*_*car 4 php postgresql

是否可以选择在PHP中使用PostgreSQL函数,因此您可以为查询指定最大执行时间?我不想从配置文件中启用它,因为只需要限制某些查询.

Hai*_*vgi 7

在主查询之前从php运行查询

喜欢

SET statement_timeout TO 5000;
Run Code Online (Sandbox Code Playgroud)

  • 请注意,您也可以通过用户或数据库进行设置:alter user bogouser set statement_timeout ='60s'; (2认同)