Generate INSERT ... RETURNING id for postgresql