pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feednotice handler in libpq-based driver
4+ messages / 3 participants
[nested] [flat]
* notice handler in libpq-based driver
@ 2005-09-06 18:18 Scot Loach <sloach@sandvine.com>
0 siblings, 0 replies; 4+ messages in thread
From: Scot Loach @ 2005-09-06 18:18 UTC (permalink / raw)
To: pgsql-odbc
With the new driver I sometimes see messages being printed to stderr, obviously the ODBC driver should not do this.
I believe the PQnoticeProcessor needs to be set, see this documentation for details of how this works.
http://www.postgresql.org/docs/7.4/interactive/libpq-notice-processing.html
It should be trivial to add this but I'm not sure what the best place to do it would be, would one of the maintainers be able to do it?
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: notice handler in libpq-based driver
@ 2005-09-07 08:38 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 4+ messages in thread
From: Dave Page @ 2005-09-07 08:38 UTC (permalink / raw)
To: Scot Loach <sloach@sandvine.com>; pgsql-odbc; +Cc: Anoop Kumar <anoopk@pervasive-postgres.com>
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Scot Loach
> Sent: 06 September 2005 19:18
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] notice handler in libpq-based driver
>
> With the new driver I sometimes see messages being printed to
> stderr, obviously the ODBC driver should not do this.
> I believe the PQnoticeProcessor needs to be set, see this
> documentation for details of how this works.
> http://www.postgresql.org/docs/7.4/interactive/libpq-notice-pr
> ocessing.html
>
> It should be trivial to add this but I'm not sure what the
> best place to do it would be, would one of the maintainers be
> able to do it?
No, I'm not sure how to handle this either - the old driver handled it
in the socket code along with other messages. I'm not sure how, with the
noticeProcessor, we would associate notices with specific statements or
connections.
I suppose we could just store them all someplace, and check/empty the
list after each libpq_execute.
Anoop, what do you think?
Regards, Dave.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: notice handler in libpq-based driver
@ 2005-09-07 14:48 Tom Lane <tgl@sss.pgh.pa.us>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2005-09-07 14:48 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Scot Loach <sloach@sandvine.com>; pgsql-odbc; Anoop Kumar <anoopk@pervasive-postgres.com>
"Dave Page" <dpage@vale-housing.co.uk> writes:
> No, I'm not sure how to handle this either - the old driver handled it
> in the socket code along with other messages. I'm not sure how, with the
> noticeProcessor, we would associate notices with specific statements or
> connections.
IIRC, the notice processor is passed a void pointer that you specify
when you set up the notice hook. Typically you'd give it a pointer to
your own data structure describing the connection. It should be able to
find out whatever it needs to know from there.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: notice handler in libpq-based driver
@ 2005-09-07 15:09 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 4+ messages in thread
From: Dave Page @ 2005-09-07 15:09 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Scot Loach <sloach@sandvine.com>; pgsql-odbc; Anoop Kumar <anoopk@pervasive-postgres.com>
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Tom Lane
> Sent: 07 September 2005 15:49
> To: Dave Page
> Cc: Scot Loach; pgsql-odbc@postgresql.org; Anoop Kumar
> Subject: Re: [ODBC] notice handler in libpq-based driver
>
> "Dave Page" <dpage@vale-housing.co.uk> writes:
> > No, I'm not sure how to handle this either - the old driver
> handled it
> > in the socket code along with other messages. I'm not sure
> how, with the
> > noticeProcessor, we would associate notices with specific
> statements or
> > connections.
>
> IIRC, the notice processor is passed a void pointer that you specify
> when you set up the notice hook.
Ahh yes, so it does. Thanks Tom.
Regards, Dave
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-09-07 15:09 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-06 18:18 notice handler in libpq-based driver Scot Loach <sloach@sandvine.com>
2005-09-07 08:38 Re: notice handler in libpq-based driver Dave Page <dpage@vale-housing.co.uk>
2005-09-07 14:48 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-09-07 15:09 Re: notice handler in libpq-based driver Dave Page <dpage@vale-housing.co.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox