title: Execute .sql schema in psycopg2 in Python
body: <p>I have a PostgreSQL schema stored in .sql file. It looks something like:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS users (
      id INTEGER PRIMARY KEY,
      facebook_id TEXT NOT NULL,
      name TEXT NOT NULL,
      access_token TEXT,
      created INTEGER NOT NULL
  );
  </code></pre>
  
  <p>How shall I run this schema after connecting to the database?</p>
  
  <p>My existing Python code works for SQLite databases:</p>
  
  <pre><code># Create database connection
  self.connection = sqlite3.connect("example.db")
  
  # Run database schema
  with self.connection as cursor:
      cursor.executescript(open("schema.sql", "r").read())
  </code></pre>
  
  <p>But the psycopg2 doesn't have an <code>executescript</code> method on the cursor. So, how can I achieve this?</p>