title: KeyError when creating a view
body: <p>I want to use SQLAlchemy to create a view in my PostgreSQL database. I'm using the CreateView compiler from sqlalchemy-views. I'm using the answer to this question as a reference:</p>
  
  <p><a href="https://stackoverflow.com/questions/9766940/how-to-create-an-sql-view-with-sqlalchemy">How to create an SQL View with SQLAlchemy?</a></p>
  
  <p>My code for creating the view looks like this:</p>
  
  <pre><code>def create_view(self, myparameter):
      mytable = Table('mytable', metadata, autoload=True)
      myview = Table('myview', metadata)
      engine.execute(CreateView(myview, mytable.select().where(mytable.c.mycolumn==myparameter)))
  </code></pre>
  
  <p>However, when I attempt to run this query, the following exception is thrown:</p>
  
  <pre><code>KeyError: 'mycolumn_1'
  </code></pre>
  
  <p>Looking at the compiled query, it seems that a placeholder for my parameter value is not being replaced:</p>
  
  <pre><code>'\nCREATE VIEW myview AS SELECT mytable.mycolumn \nFROM mytable \nWHERE mytable.mycolumn = %(mycolumn_1)s\n\n' 
  </code></pre>
  
  <p>Since the placeholder is not being replaced, the query obviously fails. However, I do not understand why the replacement does not happen, since my code does not differ much from the example.</p>
  
  <p>My first suspicion was that maybe the type of the parameter and the column were incompatible. Currently, the parameter comes in as a unicode string, which should be mapped to a text column in my database. I have also tried mapping the parameter as a long to a bigint column with the same (failed) result.</p>
  
  <p>Does anyone have another suggestion? </p>