Re: libpq: how to retrieve query result?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Вячеслав Блинников <slavmfm(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: libpq: how to retrieve query result?
Date: 2011-01-17 21:24:58
Message-ID: 21368.1295299498@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?KOI8-R?B?99HexdPMwdcg4szJzs7Jy8/X?= <slavmfm(at)gmail(dot)com> writes:
> I retrieve asynchronous queries results using PQgetResult() which returns
> NULL not in case of some error, but when results end - so there is no way to
> know if database responded successfully or there happened some error?
> For example, error can happen when column names are miswritten.

Huh? You'll get back a PGresult with error status if the query failed.
NULL implies that you already collected the PGresult and there's nothing
more to do.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message James B. Byrne 2011-01-17 21:39:54 Ad hoc report writer
Previous Message Adrian Klaver 2011-01-17 20:58:40 Re: Install PostgreSQL as part of a desktop application, but how to coop with existing installations?