def tables_and_views(self, schemas=None):
        """Returns a list of tables and views contained in the database on the
        current connection.

        If specified, schemas should be an iterable of schemas from which the
        tables/views should be gathered
        """
        sql = '''select tablename
                 from pg_tables
        	 union
        	 select viewname
        	 from pg_views
        '''
        if schemas:
            sql += "where schemaname in ("
            sql += ", ".join(["%s" for i in schemas]) + ")" 
        cursor = self.conn.cursor()
        cursor.execute(sql, schemas)
        result = cursor.fetchall()
        return [i[0] for i in result]
Returns a list of tables and views contained in the database on the
        current connection.

        If specified, schemas should be an iterable of schemas from which the
        tables/views should be gathered
        
recipes/Python/473834_simple_Object_Relational/recipe-473834.py