I want to insert a row into two tables that reference each other using not-nullable foreign key columns.
Let's say I have table A named make
make_id, bigint, (NOT NULL)
first_model_id, bigint, (NOT NULL)references
And a table B named model
model_id, (NOT NULL)
make_id, (NOT NULL)references
Is it possible within a transaction to insert a row into both of these tables, even though each of the rows does not exist? This is easily doable by making one of the columns
NULL, inserting the first row, referencing it on the second insert, then getting the new row ID from the second insert.
I'm wondering if this is possible with columns that are