From: | Steve Crawford <scrawford(at)pinpointresearch(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | libpq and unwanted stderr output |
Date: | 2005-08-19 17:16:14 |
Message-ID: | 200508191016.14855.scrawford@pinpointresearch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I have some C programs which use libpq and I do not want them to write
output to the screen (unless, of course, I direct them to do so).
When I use libpq I get unwanted messaged dumped to stderr.
Example (stripped of all error-checking, etc.):
#include "/usr/include/pgsql/libpq-fe.h"
int main ()
{
PGconn *conn;
PGresult *res;
conn = PQconnectdb ("dbname=steve");
res = PQexec (conn, "create table x (a text primary key, b text)");
PQclear (res);
PQfinish (conn);
return 0;
}
With nary a printf in sight, the following is nonetheless written to
stderr:
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"x_pkey" for table "x"
These various programs include daemons, backgrounded processes and
user processes (data input and query screens). In all cases these
messages are causing problems. How do I disable this behaviour?
Cheers,
Steve
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2005-08-19 17:20:45 | Re: How to cancel a query if SIGINT does not work? |
Previous Message | Adam Witney | 2005-08-19 17:10:28 | Re: How to cancel a query if SIGINT does not work? |