title: Postgres SSL SYSCALL error: EOF detected with python and psycopg
body: <p>Using psycopg2 package with python 2.7 I keep getting the titled error: psycopg2.DatabaseError: SSL SYSCALL error: EOF detected</p>
  
  <p>It only occurs when I add a <code>WHERE column LIKE ''%X%''</code> clause to my pgrouting query. An example:</p>
  
  <pre><code>SELECT id1 as node, cost FROM PGR_Driving_Distance(
    'SELECT id, source, target, cost 
       FROM edge_table
       WHERE cost IS NOT NULL and column LIKE ''%x%'' ',
    1, 10, false, false)
  </code></pre>
  
  <p>Threads on the internet suggest it is an issue with SSL intuitively, but whenever I comment out the pattern matching side of things the query and connection to the database works fine.</p>
  
  <p>This is on a local database running Xubuntu 13.10.</p>
  
  <p>After further investigation: It looks like this may be cause by the pgrouting extension crashing the database because it is a bad query and their are not links which have this pattern.</p>
  
  <p>Will post an answer soon ...</p>