Following this answer regarding limiting resources per query in PostgreSQL, I've been advised to set a timeout value for query execution:
SET statement_timeout TO '1min';
This is great, but sometimes I want to relax the restriction for a specific script.
- Is there a way to set the timeout as a
psqlargument? I've triedpsql --set statement_timeout=50, unsuccessfully. - Is there a way to set it from a Python script which uses psycopg2?