Given a simple autoincrement table:
an insert query returns the lastInsertId in the response package so it's accessible by clients:
but inserting data with a INSERT ... RETURNING doesn't return the lastInsertId:
Instead afterwards either the lastInsertId has to be extracted from the returned resultset, which not neccessarily must include the ID column, or an additional query to select the lastInsertId has to be executed.
compare PHP PDO client issue: https://github.com/php/php-src/issues/11503