Re: Number of updated rows with LibPQ - Mailing list pgsql-general

From Guillaume Lelarge
Subject Re: Number of updated rows with LibPQ
Date
Msg-id CAECtzeXSW-Tn_eA2WGL3X+Dw5bfzujtuVeXFQZpa9ukc=7Kv_Q@mail.gmail.com
Whole thread Raw
In response to Re: Number of updated rows with LibPQ  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
Le ven. 14 oct. 2022 à 13:52, Dominique Devienne <ddevienne@gmail.com> a écrit :
On Wed, Oct 5, 2022 at 8:17 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Laurenz Albe <laurenz.albe@cybertec.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.

pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Re: Number of updated rows with LibPQ
Next
From: Laurenz Albe
Date:
Subject: Re: Number of updated rows with LibPQ