Re: Handling notices, warnings, etc.

Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization initd.org
Message-ID <1243493281.4435.1.camel@erin>
Il giorno gio, 28/05/2009 alle 13.15 +1000, Joel Nothman ha scritto:
> I am executing some PL/PGSQL scripts through a psycopg interface.
>
> During processing, my script outputs a number of notices. How can I have  
> these notices printed when the procedure is executed through psycopg.  
> (There seems to be some concept of notice processing in the source, but I  
> haven't worked out how to access it through Python, and it doesn't seem to  
> be documented.)

You can access the .notices attribute of the connection object. It is a
list of notices received from the server.

> Even better, how can I enable the handling of notices when accessing the  
> connection through Django?

I am sorry but I don't use django.

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [email protected]
INIT.D Developer                                           fog-NGVKUo/i/[email protected]
 To prepare such test data, I get into the meaniest, nastiest frame of
  mind that I can manage, and I write the cruelest code I can think of;
  then I turn around and I embed that in even nastier constructions
  that are almost obscene.                                  -- D.E.Knuth

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkoeM5sACgkQvcCgrgZGjevfSgCeLZ/10pBnrUOK9a0wtSXWMkNm
I0sAn2F/j5KWkxmBswsFVkHQ6So8lVn4
=kMzt
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.