-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
Hi there,
If you run something like this code:
from sqlalchemy import create_engine, Table, Column, Integer, MetaData
def create_table(engine):
tablename = 'temp_foo'
id_col = Column('id', Integer, primary_key=True)
value_col = Column('value', Integer)
metadata = MetaData(bind=engine)
table = Table(tablename,
metadata,
id_col,
value_col,
prefixes=['TEMPORARY'])
table.create(engine)
return
You'll get an exception like this:
sqlalchemy.exc.NotSupportedError: (NotSupportedError) Column "temp_foo.id" has unsupported type "serial".
'\nCREATE TEMPORARY TABLE temp_foo (\n\tid SERIAL NOT NULL, \n\tvalue INTEGER, \n\tPRIMARY KEY (id)\n)\n\n' {}
I'm seeing this with sqlalchemy 0.8.3. I think your redshift dialect is inheriting the default Postgres/psycopg behavior, which doesn't work since SERIAL isn't a supported Redshift datatype.
It works fine if you use a Char or something for your primary key. (Or just create the table externally and simply refer to it.)
Thanks,
Mike
ingo-m
Metadata
Metadata
Assignees
Labels
No labels