I want to restructure my database. Therefore I want to move some columns from one table to another. The problem is that I do not want to simply insert the new column somehow into the destinationtable. Both tables have an id and I want to copy the column data depending on the id of both tables.
id bigint not null a character varying b date ...
id bigint not null c character varying d date ...
I have tried with insert into to no avail because this would add new rows in the destination table which is not what I want. Same with select into.
insert into table2 as t2 (c,d) select t1.a, t1.b from table1 as t1 where t1.id = t2.id