开发者

SQLAlchemy set index on coalesce

I am trying to set up an index for a table on the coalesce function, rather than on a column. I am using PostgreSQL and I am trying to achieve something like :

create index t on tbl using btree (coalesce(ts_updated, '2002-08-08'))

Anyone knows how can I achieve this with SQLAlch开发者_开发问答emy in the ORM framework?


SQLAlchemy doesn't support expression in index definitions yet, but it's a planned feature. Right now you have to use custom DDL (see examples in documentation).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜