Thread: Changing GENERATED ALWAYS AS expression

Changing GENERATED ALWAYS AS expression

From
Will Bryant
Date:
Hello,

I’ve been testing out the 12 (beta) support for generated columns, mainly in order to add support for them to the
databasesynchronisation software I maintain (Kitchen Sync). 

So far it looks good compared to the similar functionality on MariaDB and MySQL (apart from VIRTUAL support which I see
waspulled out because it wasn’t ready). 

But I can’t see a way to change the expression for the generated column after its been created initially. I was looking
forsomething like the SET/DROP NOT NULL alter clauses, perhaps ALTER TABLE foo ALTER bar SET GENERATED ALWAYS AS (…)
STORED,but that doesn’t work and I can’t see anything in the docs.  (MySQL/MariaDB don’t have anything specific, but
theyhave the generic MODIFY column syntax which does allow you to change stored column definitions.) 

I can remove and add back the column, but that has the undesirable effect of changing the column order and requires
recreatingall the indexes etc. which gets messy. 

Any thoughts?  Will this be implemented later?

Cheers,
Will