sqlalchemy-redshift: Redshift does not support sequences
The dialect needs to specify that sequences are not supported. Otherwise sqlalchemy tries to reference a nonexistent sequence and you get an error such as the following:
(sqlalchemy.exc.ProgrammingError) (psycopg2.ProgrammingError) relation "tablename_model_id_seq" does not exist [SQL: 'select nextval(\'"tablename_model_id_seq"\')'] [SQL: u'INSERT INTO tablename (model_id, model_name) VALUES (%(model_id)s, %(model_name)s,)']
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 19 (6 by maintainers)
Commits related to this issue
- fix issue #48 - Redshift does not support sequences — committed to mtambos/sqlalchemy-redshift by mtambos 8 years ago
- fix issue #48 - Redshift does not support sequences — committed to jseabold/sqlalchemy-redshift by mtambos 8 years ago
I think I got it working by setting
I’m still debugging things, but so far there’s no been any primary key related errors.
Any updates on this?
@aboedo done
Hey nwbvt, thank you so much! It kind of works. The ‘(psycopg2.ProgrammingError) relation “tablename_model_id_seq” does not exist’ error is solved by setting those two variables to False, but now I’m getting the following:
I guess there should be a
immediately following the
INSERT INTO [entity_table]statement.I’m kind of new to SqlAlchemy, do you have any idea where/what should I modify in sqlalchemy_redshift to add this?
Thanks again,
Mario