开发者

SQLAlchemy set index on coalesce

开发者 https://www.devze.com 2023-01-30 10:07 出处:网络
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 :

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

精彩评论

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