On Fri, Jun 8, 2018, 12:11 AM Hick Gunter <h...@scigames.at> wrote: > > > > > >I've encountered a feature that I think would be awesome: > >https://www.postgresql.org/docs/9.3/static/dml-returning.html > > > >Example: INSERT INTO blah (this, that, another) VALUES (x, y, z) > RETURNING id; > > > > What does this do if the INSERT creates multiple rows? What about inserts > generated from trigger programs?
Excellent questions that I don't know the answers to, but this does not stop me from having an opinion. I think if multiple rows are inserted, this should return multiple rows. It is effectively a select of the inserted data. Triggers are external to the insert, so I would expect them to not contribute to the returning syntax result set. Ultimately I expect, if accepted as an enhancement to SQLite, the team would ask WWPGD, and model the implementation on that. I am not an expert at PG so my ideas above could be way off base. I would think DML statements using returning could be used anywhere a select could be used making for more expressive SQL without necessarily needing to drop to the host language. Just a thought that I found interesting. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users