title: selecting rows from postgres using sqlalchemy
body: <p>I'm trying to connect to my postgres database and do a select statement.The code is given below.</p>
  
  <p>I get a error saying table1 is undefined...Table1 is in the database..how table1 will be recognized in my code.</p>
  
  <p>code.py</p>
  
  <pre><code>engine1 = create_engine('postgresql://username:password@localhost/testdb')
  
  Session1 = sessionmaker(bind=engine1)
  session1 = Session1()
  
  for each in session1.query(table1).all():
      print each
  </code></pre>