I'm trying to add a generated column in existing table. I've a transaction table, in that table I've one column named as dateTime(containing date and time in timestamp format). I want to create a virtual column named as transactionDate which will contain a date and time derived from dateTime column.
Below is the query which I created
ALTER TABLE public.transaction ADD COLUMN "transactionDate" timestamp without time zone GENERATED ALWAYS AS (timestamp("dateTime")::date) STORED;
and I'm getting below error:
ERROR: syntax error at or near ""dateTime"" LINE 2: ... without time zone GENERATED ALWAYS AS (timestamp("dateTime"... ^ SQL state: 42601 Character: 121
Please help me out.