Add generated column to an existing table Postgres
I am trying to add a generated column to an existing table with this script. alter table Asset_Store add column md5_hash VARCHAR(100) GENERATED ALWAYS AS (CAST(UPPER( case when OR_ID is not null then MD5(cast(OR_ID as varchar(100))) when Asset_ID is not null then MD5(Asset_ID) else null end ) as VARCHAR(100))) STORED ; but I am getting an error: SQL Error [4