Having a problem with this, trying to add a column which returns the year from a date column in postgresql 10: This is my SQL
ALTER TABLE stats ADD COLUMN year_ integer GENERATED ALWAYS AS (date_part('year', date)) STORED;
However, this returns a syntax error in the SQL window. I have looked up the online documentation and have no idea what is going wrong, also tried with the EXTRACT function and I keep on getting the same error of the sort
ERROR: syntax error at or near "("
LINE 1: ...tats ADD COLUMN year_ integer GENERATED ALWAYS AS (date_part...