Use-case: As a Node-RED user with the postgres node installed, I am inserting records into a postgres database that assigns a UUID/GUID to each record as part of DB logic, therefore I need the list of pg records successfully returned in order to successfully perform additional updates on those records using the DB assigned UUID.
Current outcome: as a user of the postgres node, the only data returned from a successful INSERT is the msg.psql object which informs how many rows were impacted by the given operation, but no other data is returned.
Please let me know if I am missing something/need to assign a param somewhere. Thanks!
This was actually a knowledge gap on my part: By appending RETURNING <column_name1>,<column_name2> in your SQL DML statement, you can return column names of the affected records in the msg.payload property.
Use-case: As a Node-RED user with the postgres node installed, I am inserting records into a postgres database that assigns a UUID/GUID to each record as part of DB logic, therefore I need the list of pg records successfully returned in order to successfully perform additional updates on those records using the DB assigned UUID.
Current outcome: as a user of the postgres node, the only data returned from a successful INSERT is the
msg.psql
object which informs how many rows were impacted by the given operation, but no other data is returned.Please let me know if I am missing something/need to assign a param somewhere. Thanks!