Closed azjezz closed 2 years ago
OIDs are not the same as MySQL's auto_increment columns: https://stackoverflow.com/questions/5625585/sql-postgres-oids-what-are-they-and-why-are-they-useful
To retrieve the last value of a sequence, use RETURNING
on the query: https://www.postgresql.org/docs/14/dml-returning.html
The
pg
driver offerspg_last_oid
function that can be used to retrieve the last oid from a result, however, amphp doesn't offer a high level access to this function ( similar to thegetLastInsertId
in amphp/mysql ), or access to the underlying result handle.I think adding
getLastInsertId
would be a good start, while offering access to the underlying result handle ( or possible all types of handles, e.g: pg handle, socket connection, ... etc ) might be dangerous, it's a good feature to have that would allow people that know what they are doing to play around.