NOTICE-messages in C++

Started by Colin Taylorover 25 years ago4 messagesgeneral
Jump to latest
#1Colin Taylor
Colin_Taylor@PortaSystemsDev.com

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Colin Taylor (#1)
Re: NOTICE-messages in C++

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

#3Michael Meskes
meskes@postgresql.org
In reply to: Colin Taylor (#1)
Re: NOTICE-messages in C++

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!

#4Fernando Caamaño
fernando@interweb-research.net
In reply to: Colin Taylor (#1)
how can I unsuscribe from the list?

thank you
Fernando Caama�o
Programador web
Interweb Research
www.interweb-research.net