Thread: NOTICE-messages in C++

NOTICE-messages in C++

From
Colin Taylor
Date:
Hi postgreSQL'ers,
How can I catch NOTICE messages from the backend using C++.
I am sending the query "show DateStyle".
The logs show the NOTICES message being returned by the backend.
But I cannot retrieve the message into the C++ code.
I am using the PQ++ libraries.
Thanx,
Colin

Re: NOTICE-messages in C++

From
Tom Lane
Date:
Colin Taylor <Colin_Taylor@portasystemsdev.com> writes:
> How can I catch NOTICE messages from the backend using C++.

There is a provision in libpq to let the application install its own
callback routine for handling NOTICE messages.  But AFAIR, libpq++
doesn't expose that libpq feature :-(.  Feel free to contribute a fix.

            regards, tom lane

Re: NOTICE-messages in C++

From
Michael Meskes
Date:
On Thu, Oct 19, 2000 at 10:54:06AM +0100, Colin Taylor wrote:
> How can I catch NOTICE messages from the backend using C++.
> ...

I never used libpq++ but I know how it's done with libpq. Just look into
file src/interfaces/ecpg/lib/connect.c function ECPGconnect to see how to
install your own notice handler. To be honest, I did not write the code my
self, but Christof Petig <christof.petig@wtal.de> did. :-)

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

how can I unsuscribe from the list?

From
Fernando Caamaño
Date:
thank you
Fernando Caamaño
Programador web
Interweb Research
www.interweb-research.net