but I'm doing:I want to import data from table A to table B, but when doing it the column "code" on table B has to have some unique random data.I could use UUID like:insert into "TB" ("Id", "Title") values (uuid_generate_v4(), '111');INSERT INTO tableb (SELECT * FROM TABLEA)So, how to use UUID using the SELECT above?
By explicitly listing column names instead of using "*" and then instead of copying a column from A to B you omit the column from A and replace it with a function call.
INSERT INTO tableb ("Id", "Title")
SELECT uuid_generate_v4(), "Title"
FROM tablea;
David J.