title: Expand Timeout while executing query on PSycopg2/Postgres
body: <p>I am working on complex query that takes hours to execute.
  I am using PSycopg2 to </p>
  
  <p>By reading this <a href="https://dba.stackexchange.com/questions/1372/postgresql-set-ing-from-psql-arguments">Post</a> . I added this statement :</p>
  
  <pre><code> import os.environ
      ['PGOPTIONS'] = '-c statement_timeout=1000000'
  </code></pre>
  
  <p>Now, I am getting an error every-time, I execute this query :   </p>
  
  <pre><code>import psycopg2
  &gt;&gt;&gt; cnn = psycopg2.connect("dbname=test options='-c statement_timeout=1000'")
  &gt;&gt;&gt; cur = cnn.cursor()
  &gt;&gt;&gt; cur.execute("select pg_sleep(200000)")
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  psycopg2.extensions.QueryCanceledError: canceling statement due to statement timeout
  </code></pre>
  
  <p>My question: 
  How can I force the application to take a long time to process the query ? </p>