Insert query for PostgreSQL
According to all messages there are two ways to solve the problem :

1) db_insert

Using db_insert() to insert data and create a specific query for postgreSQL database to get the last id after insert :

// Default insert    
(...)-&gt;insert("...");

// Call this query to get last id only for pgSQL
(...)-&gt;query("SELECT currval('sequence')")-&gt;fetchAll();


You juste need to replace sequence by the key provided in your postgreSQL database.

You have to call currval right after insert to stay in the same context.

2) db_query

Rewriting the entire query with specific synthax for postgreSQL database to get the last id :

(...)-&gt;query("INSERT INTO {$table} ($fields) VALUES($value) RETURNING $id")-&gt;fetchField();


Conclusion

The first solution seems to be the best to avoid rewriting all db_insert() functions.