return last insert id for pgsql db