title: Why does psycopg2 cursor.execute() with SQL query parameter cause syntax error?
body: <p>When specifying a parameter to execute() in psycopg2 in Python, like this:</p>
  
  <pre><code>cursor.execute('SELECT * FROM %s', ("my_table", ))
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>psycopg2.ProgrammingError: syntax error at or near "'my_table'"
  LINE 1: SELECT * FROM 'my_table'
  </code></pre>
  
  <p>What am I doing wrong?  It looks like psycopg2 is adding single quotes to the query, and those single quotes are causing the syntax error.</p>
  
  <p>If I don't use a parameter, it works correctly:</p>
  
  <pre><code>cursor.execute('SELECT * FROM my_table')
  </code></pre>