title: How to avoid multiple queries in one execute call
body: <p>I've just realized that <code>psycopg2</code> allows multiple queries in one <code>execute</code> call.</p>
  
  <p>For instance, this code will actually insert two rows in <code>my_table</code>:</p>
  
  <pre><code>&gt;&gt;&gt; import psycopg2
  &gt;&gt;&gt; connection = psycopg2.connection(database='testing')
  &gt;&gt;&gt; cursor = connection.cursor()
  &gt;&gt;&gt; sql = ('INSERT INTO my_table VALUES (1, 2);'
  ...        'INSERT INTO my_table VALUES (3, 4)')
  &gt;&gt;&gt; cursor.execute(sql)
  &gt;&gt;&gt; connection.commit()
  </code></pre>
  
  <p>Does <code>psycopg2</code> have some way of disabling this functionality? Or is there some other way to prevent this from happening?</p>
  
  <p>What I've come so far is to search if the query has any semicolon (<code>;</code>) on it:</p>
  
  <pre><code>if ';' in sql:
      # Multiple queries not allowed!
  </code></pre>
  
  <p>But this solution is not perfect, because it wouldn't allow some valid queries like:</p>
  
  <pre><code>SELECT * FROM my_table WHERE name LIKE '%;'
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT:</strong> SQL injection attacks are not an issue here. I do want to give to the user full access of the database (he can even delete the whole database if he wants).</p>