I’m writing a library that wraps libpq in C. When I execute a query like DROP SCHEMA IF EXISTS bob, and bob doesn’t exist, libpq outputs
"NOTICE: schema "bob" does not exist, skipping"
into my terminal, but then succeeds. Similarly, if I create a table with id serial primary key it prints a notice that it auto-generated a sequence.
How do I stop it printing this into the terminal? I have functions in my library to obtain such information, if the user needs it, but it should not just output into the terminal like this.
I didn’t see anything in the documentation for PQexecParams(), or PQconnectdb() etc.
See libpq – notice processing in the manual. You need to supply a notice processor to replace the default one.