Reputation: 199
I am using PostgreSQL 9.3.19, earlier I have made the following Query
SELECT DATE_TRUNC('minute', some_date) FROM some_table;
This was working fine but I got to know that index made on some_date column will be futile because indexes doesn't work with DATE_TRUNC(), Index created was as follows :
CREATE INDEX ON some_table USING BTREE(DATE_TRUNC('minute', some_date));
So is there any other way to truncate seconds without affecting my present Index and without using DATE_TRUNC in PostgreSQL 9.3.19 ?
Upvotes: 1
Views: 4563