title: Psycopg2 command hangs, possibly because of table name?
body: <p>The code below hangs (even ctrl-C won't stop it, I have to close the terminal) when it tries to create the second table, and I'm not sure why. The first table is created successfully (I can see it in psql with \dt cyanobacteria.*). A simple solution would be to rename the table, but I'm trying to restore someone else's code to working order and I'd have to go through changing lots of stuff. And he had it working once, so it ought to work for me!</p>
  
  <p>I've created a database called 'genomes', a user called 'genomes_admin' and a schema called 'cyanobacteria'. Then I try to make some tables:</p>
  
  <pre><code>#!/usr/bin/python
  import psycopg2
  
  psql = "dbname='genomes' user='genomes_admin'"
  schm = 'cyanobacteria'
  
  conn = psycopg2.connect(psql)
  cur = conn.cursor()
  cur.execute('''SET search_path TO %s''', (schm,))
  conn.commit()
  
  cur.execute('''CREATE TABLE IF NOT EXISTS testnm(blah text, length int) ''')
  print 'created testnm'
  conn.commit()
  print 'committed'
  
  cur.execute('''CREATE TABLE IF NOT EXISTS genomes(blah text, length int) ''') # hangs here
  print 'created genomes'  # this line never executes
  conn.commit()
  print 'committed'
  cur.close()
  conn.close()
  </code></pre>