RETURNING retrieves the modified, inserted or deleted values of columns. Without RETURNING, there would be a need to run an extra SELECT query.So, along with many other benefits like triggering actions in your application based on what really gets modified, it helps to avoid a round trip and still gets the same job done! Number of queries running can be important for performance of your application as well. So you can have your cake and eat it too!
Speakers: Rucha Deodhar