title: How to rename an existing table?
body: <p>I want to create 200+ tables using declarative base on the fly. I learnt it's not possible, so my idea was to create a common table and rename it 200+ times.</p>
  
  <pre><code>class Movie(Base):
  
      id = Column(Integer, primary_key=True)
      title = Column(String)
      release_date = Column(Date)
      name=Column(String)
      __tablename__ = 'titanic'
  
      def __init__(self, newname,title, release_date):
          self.title = title
          self.release_date = release_date
  </code></pre>
  
  <p>What is the code to change the table name from "titanic" to "wild"?</p>
  
  <p>In Postgresql it is</p>
  
  <pre><code>ALTER TABLE table_name
  RENAME TO new_table_name;
  </code></pre>
  
  <p>I am not finding a solution in sqlalchemy.</p>
  
  <p>There are no foreign keys to this table.</p>
  
  <p>The objective of this question is to rename an existing table thru a solution (if) available in sqlalchemy, not in a purely python way (as mentioned in the other question).</p>