I am using Adodb and Postgresql. When I insert a row, it increments the ID field using SERIAL.
Is it possible to return the newly created ID number right after the insert?
I am using Adodb and Postgresql. When I insert a row, it increments the ID field using SERIAL.
Is it possible to return the newly created ID number right after the insert?
Treat your INSERT the same as a SELECT and use RETURNING in your INSERT-query:
INSERT INTO foo (bar) VALUES('Doe') RETURNING id;
Fetch the result and you're done. Works since version 8.2