Getting lastInsertId in postgres by sequence