title: Python psycopg2 - using .format() with a dbname inside a string
body: <p>I'm using psycopg2 to query a database that starts with a number + ".district", so my code goes like:</p>
  
  <pre><code>number = 2345
  
  cur = conn.cursor()
  myquery = """ SELECT *
                FROM  {0}.districts
                ;""".format(number)
  
  cur.execute("""{0};""".format(query))
  data = cur.fetchall()
  conn.close()
  </code></pre>
  
  <p><strong>And i keep receiving the following psycopg2 error..</strong></p>
  
  <p>psycopg2.ProgrammingError: syntax error at or near "2345."
  LINE 1: SELECT * FROM  2345.districts...</p>
  
  <p>Thought it was the type of data the problem, maybe int(number) or str(number)..but no, same error appears. </p>
  
  <p>¿ What am i doing wrong ? </p>