ERROR: functions in index expression must be marked IMMUTABLE in Postgres

后端 未结 5 541
予麋鹿
予麋鹿 2020-11-30 10:01

I want to create a Multicolumn expression index, but when I create the index, the following message is output:

--detail message 
wapgrowth=> create index          


        
5条回答
  •  攒了一身酷
    2020-11-30 10:24

    Instead of using to_char to format your timestamp as YYYY-MM-DD, try casting your timestamp to a date type, which will have the same effect:

    create index CONCURRENTLY idx_test on  tmp_table using btree (skyid, cast(create_time as date), actiontype );
    

提交回复
热议问题