标签: sql postgresql indexing
我正在尝试在DATE的列上添加带有年龄的函数索引:
create index index_test on utenti(EXTRACT(year FROM AGE(birthday)));
有没有办法使它起作用?
编辑: 认为可能是由于时区,我尝试了这个 create index index_test on utenti(EXTRACT(year FROM AGE(birthday AT TIME ZONE 'utc')));
create index index_test on utenti(EXTRACT(year FROM AGE(birthday AT TIME ZONE 'utc')));
但我仍然遇到相同的错误