I don't know if SQLAlchemy has an easy way of determining this metadata, but
you can likely query the system tables directly. pg_attrdef stores this
information in the adbin/adsrc columns. You can parse the adsrc column to
get the sequence name. You can filter your query easily by table and/or
When I try to load the database metadata via reflection:
engine = create_engine(...)
metadata = MetaData()
metadata.bind = engine
metadata.reflect()
It successfully loads all the tables and columns present; however, it does
not appear to load the unique
reflection currently does not *consistently* pick up things
like unique constraints, check constraints, or indexesi
say consistently because some efforts have been made to add
some of these things to the MySQL and Postgres dialects
(although i think the postgres ones might just be