General Bug Report: Documentation problem - Mailing list pgsql-bugs

From Unprivileged user
Subject General Bug Report: Documentation problem
Date
Msg-id 199904170906.FAA02883@hub.org
Whole thread Raw
Responses Re: [BUGS] General Bug Report: Documentation problem  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : Dan Merillat
Your email address      : Dan@merillat.org

Category                : install: other
Severity                : non-critical

Summary: Documentation problem

System Configuration
--------------------
  Operating System   : N/A

  PostgreSQL version : 6.3

  Compiler used      : N/A

Hardware:
---------
N/A

Versions of other tools:
------------------------
N/A

--------------------------------------------------------------------------

Problem Description:
--------------------
libpq documentation has a few errors.  Most notably, the reccomended style of error handling.
psuedocode: res=PQexec(conn, "error-prone-statement"); if (PQresultStatus(res) != PGRES_TUPLES_OK) { do_error_code(); }
This is actually incorrect, since on error, PQexec returns null, so PQresultStatus (which I can't find documented)
derefrencesa null pointer. 
Correct example code would be res=PQexec(conn, "error-prone-statment"); if (!res) { printf("PQexec(): %s\n",
PQerrorMessage(conn));exit(1) } 

If nobody else is working on the documentation reply to me, and I'll submit diffs.

--Dan


--------------------------------------------------------------------------

Test Case:
----------


--------------------------------------------------------------------------

Solution:
---------


--------------------------------------------------------------------------


pgsql-bugs by date:

Previous
From: Joao Luiz Kohl Moreira
Date:
Subject: postmaster
Next
From: Bruce Momjian
Date:
Subject: Re: [BUGS] General Bug Report: Documentation problem