Answer the question
In order to leave comments, you need to log in
How to organize transactions with returning?
There are several tables with related data.
The data is linked by id.
After adding data to the first table, the row id is formed and the data is returned via returning to add it to other tables.
Table | ID | val |
example: Returning example:
INSERT INTO table (val) VALUES ( 'data' ) RETURNING ID
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question