title: psycopg2 cannot execute multiple queries
body: <p>I'm having issues with executing multiple queries on my psql db using psycopg2. Example:</p>
  
  <pre><code>#!/usr/bin/env python
  #-*- coding: utf-8 -*-
  
  import psycopg2
  from psycopg2.extras import RealDictCursor
  
  def CreateUser(user, mySchema):
  
      conn = psycopg2.connect("dbname='postgres' user='root' password='somePassword' host='localhost'")
      cur = conn.cursor()
      cur.execute("""create user %s""" % (user)) 
      conn.commit()
      cur.close()
      conn.close()
      CreateSchema(user, mySchema)
  
  
  def CreateSchema(user, mySchema):
      conn = psycopg2.connect("dbname='postgres' user='root' password='somePassword' host='localhost'")
      cur = conn.cursor()
      cur.execute("""create schema %s authorization %s """ % (user,mySchema))
      conn.commit()
      cur.close()
      conn.close()
  
  def FetchUserInput():
      userInput = raw_input("UserName")
      mySchema = raw_input("SchemaName")
      CreateUser(userInput, mySchema)
  
  
  FetchUserInput()
  </code></pre>
  
  <p>In this case, the second query fails with an error that the user created previously does not exist! 
  If I only execute the CreateUser function, it works fine. 
  If I execute it manually within psql, it works fine.</p>
  
  <p>As If the first commit isnt executed on the database when I open up a second connection within the CreateSchema function, which makes no sense. </p>
  
  <p>What am I doing wrong?</p>