extract postgresql date code example
Example 1: get year from date postgres
SELECT EXTRACT(YEAR FROM column_date);
Example 2: postgresql today - 1 year
select now() - INTERVAL '1 YEAR';
Example 3: postgres extract date from timestamp
SELECT DATE(column_name) FROM table_name;
Example 4: postgres extract date from timestamp
SELECT DATE(SUBSTRING('2018-07-25 10:30:30' FROM 1 FOR 10));