Declaring functional (func.lower) does not work as expected with declarative
Issue #2799
resolved
Attached is a very simple case.
Comments (2)
-
Account Deleted -
repo owner - changed status to wontfix
the index needs to be associated with at least one column in the table. The string "tag" is not a column, to SQLAlchemy its an arbitrary expression. usage is as follows:
from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class FuncIndex(Base): __tablename__ = 'funcindex' id = Column(Integer, primary_key=True) tag = Column(String(20)) __table_args__ = ( Index('funcindex_idx', func.lower(tag)), ) e = create_engine("postgresql://scott:tiger@localhost/test", echo=True) Base.metadata.create_all(e)
- Log in to comment
Err, declaring functional index does not work.