Fix pgsql syntax for last insert id