[Sqlalchemy-tickets] Issue #4122: postgresql get_indexes() is returning a record for an EXCLUDE con
Brought to you by:
zzzeek
From: Michael B. <iss...@bi...> - 2017-10-25 15:37:57
|
New issue 4122: postgresql get_indexes() is returning a record for an EXCLUDE constraint https://bitbucket.org/zzzeek/sqlalchemy/issues/4122/postgresql-get_indexes-is-returning-a Michael Bayer: not sure what's going on here because the table.indexes collection does not get an entry, but in any case this breaks Alembic: ``` #!python from sqlalchemy import * from sqlalchemy.dialects.postgresql import ExcludeConstraint, TSRANGE m = MetaData() Table( 't', m, Column('id', Integer, primary_key=True), Column('period', TSRANGE), ExcludeConstraint(('period', '&&'), name='quarters_period_excl') ) e = create_engine("postgresql://scott:tiger@localhost/test", echo='debug') # e.execute("CREATE EXTENSION btree_gist") m.drop_all(e) m.create_all(e) insp = inspect(e) print insp.get_indexes('t') # m2 = MetaData() # t2 = Table('t', m2, autoload_with=e) # print t2.indexes ``` output: [{'unique': False, 'duplicates_constraint': u'quarters_period_excl', 'name': u'quarters_period_excl', 'dialect_options': {'postgresql_using': u'gist'}, 'column_names': [u'period']}] |