[Sqlalchemy-tickets] Issue #3786: Postgres Table Declaration Error (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
From: Philip M. <iss...@bi...> - 2016-08-31 17:12:16
|
New issue 3786: Postgres Table Declaration Error https://bitbucket.org/zzzeek/sqlalchemy/issues/3786/postgres-table-declaration-error Philip Martin: I don't think I had this issue previously, but I have noticed since using: python: 3.5.2 sqlalchemy: 1.0.13 I run into the error doing the following: ```python table = sa.Table('foobar', sa.MetaData(), sa.Column('foo', sa.CHAR(7), primary_key=True) engine.execute(table) Traceback (most recent call last): engine.execute(table) File "/anaconda/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1991, in execute return connection.execute(statement, *multiparams, **params) File "/anaconda/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 914, in execute return meth(self, multiparams, params) File "/anaconda/lib/python3.5/site-packages/sqlalchemy/sql/schema.py", line 65, in _execute_on_connection return connection._execute_default(self, multiparams, params) File "/anaconda/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 942, in _execute_default ret = ctx._exec_default(default, None) File "/anaconda/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 952, in _exec_default if default.is_sequence: AttributeError: 'Table' object has no attribute 'is_sequence' In[80]: table.create(engine) ``` The ddl statement does execute when I run: ```python engine.create(table) ``` |