Is there a way to create a table that has the same structure as another table, but with additional columns?
From this question, I can copy a table's structure with:
CREATE TABLE new_table_name ( like old_table_name including all)
And then I can add columns one at a time, with ALTER TABLE new_table_name ADD COLUMN...
but I am looking for a way to do this more succinctly, like:
CREATE TABLE new_table_name ( like old_table_name including all), new_col1 new_col1_type, new_col2 new_col2_type,...
Best Answer
You can use the syntax below;
The fiddle is here