Reputation: 575
I am creating a web application in php(using Laravel), I would like to set a query execution timeout to PostgreSQL but I don't have access to server configuration, so is there any other way set query execution timeout through application level?
Thank you
Upvotes: 16
Views: 34370
Reputation: 3495
Simply send the following statement:
set statement_timeout TO 100;
Postgresql will then cancel all queries exceeding 100ms.
Upvotes: 20