Re: Number of updated rows with LibPQ

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Number of updated rows with LibPQ
Дата
Msg-id 2433846.1664993828@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Number of updated rows with LibPQ  (Dominique Devienne <ddevienne@gmail.com>)
Ответы Re: Number of updated rows with LibPQ  (Dominique Devienne <ddevienne@gmail.com>)
Список pgsql-general
Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Wed, 2022-10-05 at 16:38 +0200, Dominique Devienne wrote:
>> For selects, I have [PQnTuples][2], but what to do on INSERT, UPDATE, DELETE?
>> Parse the result of PQcmdTuples myself??? If so, what's the 0 in the
>> INSERT below?

> 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", so
> you won't have to parse anything.

Yeah, just applying atoi() or atol() to the result should be enough.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Christophe Pettus
Дата:
Сообщение: Re: Replication between Master PostgreSQL database version 9.6.1 and Standby/Slave PostgreSQL database version 10.17.
Следующее
От: Josef Šimánek
Дата:
Сообщение: Re: Postgres calendar?