WITH CTE1 AS ( SELECT.... ) CTE2 AS ( INSERT....RETURNING insertid ) INSERT INTO TABLE2 insertid as FK, otherdata...
The CTEs are executed in define-order as a single complete transaction, no need to use multiple calls to insert relational data
WITH CTE1 AS ( SELECT.... ) CTE2 AS ( INSERT....RETURNING insertid ) INSERT INTO TABLE2 insertid as FK, otherdata...
The CTEs are executed in define-order as a single complete transaction, no need to use multiple calls to insert relational data