I see this question everywhere. I sure hope there is an answer.
Use case:
Master table that has a column (id) with "generated always as identity..." so it will create the unique id.
Other tables that have a foreign key (id_fk).
1. Insert row into master table.
2. Retrieve the unique id that was just auto created in the master table.
3. insert rows into the other tables using the value of id in the id_fk column.
↧