example for PGRES_COMMAND_OK

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема example for PGRES_COMMAND_OK
Дата
Msg-id CAK3UJRG262OrX4jVZJXvWRFQqQ_B1HaY2qK_r28Efb3wOJDPog@mail.gmail.com
обсуждение исходный текст
Ответы Re: example for PGRES_COMMAND_OK
Список pgsql-docs
Hi all,

This libpq page:
  http://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQRESULTSTATUS

has claimed since at least the 7.x days:
| PGRES_COMMAND_OK is for commands that can never return rows (INSERT,
UPDATE, etc.)

However, as of 8.2 we support the popular INSERT ... RETURNING and
UPDATE ... RETURNING, both of which will naturally give a successful
PQresultStatus() of PGRES_TUPLES_OK. So I think this explanation
deserves an amendment. We could just change the example commands to
e.g. TRUNCATE for simplicity, but I do like that the current example
commands are INSERT and UPDATE, since it reinforces the notion that a
plain INSERT or UPDATE affecting no rows would still return
PGRES_COMMAND_OK.

Suggested change attached.

Josh

Вложения

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

Предыдущее
От: Josh Kupershmidt
Дата:
Сообщение: Re: Formatting complaints
Следующее
От: "Erik Rijkers"
Дата:
Сообщение: LATERAL synopsis