Get the auto id for inserted row into Redshift table using psycopg2 in Python
Currently not possible with Redshift, as it doesn't support returning the last insert id via the RETURNING syntax. What you might need to do is use a SELECT MAX(id) FROM schema.table;
inside a transaction, which probably not quite what you wanted to hear but appears to be the best you can do with the current state of Redshift.