Re: Notices during execution - Mailing list psycopg

From Oswaldo
Subject Re: Notices during execution
Date
Msg-id 4E748397.50404@soft-com.es
Whole thread Raw
In response to Notices during execution  (Jason McKellar <jason@deadtreepages.com>)
List psycopg
El 16/09/2011 21:05, Jason McKellar escribió:
> Hello,
>
> Is there a way to get messages output using raise notice while a
> function is executing?
>
> I have a long-running (10 minutes) function that raises notices every 10
> seconds or so about what it is currently doing and would like to view
> them while the function is running. I suppose a workaround if I can't do
> this in Psycopg2 is to execute psql and get the stdout.
>

The connection object has a 'notices' property, see:
<http://initd.org/psycopg/docs/connection.html>

Note that if you use synchronous mode you can't check the messages ultil
the query has finished. I don't know if using threads the notices can be
readed while que query is in execution.

Regards


--
Oswaldo

psycopg by date:

Previous
From: Jason McKellar
Date:
Subject: Notices during execution
Next
From: Nicklas Börjesson
Date:
Subject: Problems with Python 3.2.