Re: [GENERAL] libpq confusion - Mailing list pgsql-general

From John R Pierce
Subject Re: [GENERAL] libpq confusion
Date
Msg-id 510d23a6-ea15-90ae-fbef-d30c76817b34@hogranch.com
Whole thread Raw
In response to Re: [GENERAL] libpq confusion  (Igor Korot <ikorot01@gmail.com>)
Responses Re: [GENERAL] libpq confusion
List pgsql-general
On 9/20/2017 10:34 AM, Igor Korot wrote:
>From the documentation:
https://www.postgresql.org/docs/9.1/static/libpq-exec.html

[quote]
PGRES_COMMAND_OK

Successful completion of a command returning no data.
[/quote]

No data = no rows, right?

from that same page, a bit farther down, clarifying the potentially confusing wording.

If the result status is PGRES_TUPLES_OK, then the functions described below can be used to retrieve the rows returned by the query. Note that a SELECT command that happens to retrieve zero rows still shows PGRES_TUPLES_OK. PGRES_COMMAND_OK is for commands that can never return rows (INSERT, UPDATE, etc.). A response of PGRES_EMPTY_QUERY might indicate a bug in the client software.


-- 
john r pierce, recycling bits in santa cruz

pgsql-general by date:

Previous
From: Igor Korot
Date:
Subject: Re: [GENERAL] libpq confusion
Next
From: Igor Korot
Date:
Subject: Re: [GENERAL] libpq confusion