Re: Number of updated rows with LibPQ

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Number of updated rows with LibPQ
Date: 2022-10-14 12:26:04
Message-ID: CAECtzeXSW-Tn_eA2WGL3X+Dw5bfzujtuVeXFQZpa9ukc=7Kv_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le ven. 14 oct. 2022 à 13:52, Dominique Devienne <ddevienne(at)gmail(dot)com> a
écrit :

> On Wed, Oct 5, 2022 at 8:17 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
> > > On Wed, 2022-10-05 at 16:38 +0200, Dominique Devienne wrote:
> > > Yes, you have to use PQcmdTuples(), and you have to convert the string
> to an integer.
> > > But don't worry: the result will *not* be "INSERT 0 5", it will be
> just "5"
>
> Thanks. What's the leading 0 though, then?
>

The leading number was the OID of the inserted row if you only had one row
and if the table had OID on rows. Otherwise, it was zero. It's always 0
nowadays since you can't have OID on rows.

--
Guillaume.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2022-10-14 12:28:59 Re: Number of updated rows with LibPQ
Previous Message Dominique Devienne 2022-10-14 11:52:32 Re: Number of updated rows with LibPQ