Re: PQdb() fails with coredump when PQconnectDB() passed invalid parameter. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: PQdb() fails with coredump when PQconnectDB() passed invalid parameter.
Date
Msg-id 12706.1096652194@sss.pgh.pa.us
Whole thread Raw
In response to Re: PQdb() fails with coredump when PQconnectDB() passed invalid parameter.  (Michael Fuhr <mike@fuhr.org>)
List pgsql-bugs
Michael Fuhr <mike@fuhr.org> writes:
> PQdb() is returning NULL, which causes fprintf() to dump core.

It is actually documented that a failed connection might return NULL for
this, so the example code is wrong.  I've corrected the examples to not
assume PQdb can be used on a failed connection.

pg_dump was doing it wrong too :-(

            regards, tom lane

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Bug in PostrgeSQL 8.0beta
Next
From: Andrew Grillet
Date:
Subject: Bug report