add support for PostgreSQL notice messages

Issue #877 resolved
Former user created an issue

The PostgreSQL backend can issue additional notice messages, in addition to usual error messages.

These notice messages can be very useful for debugging purpose.

An example can be found in this post on the sqlalchemy mailing list: http://groups.google.it/group/sqlalchemy/t/c5e2dd0f2d48e1e9

The psycopg2 driver does support notices messages; they are stored in a notices attribute in the connection object.

SQLAlchemy can do two things with notice messages: * Log all notices messages, when a custom option is enabled (echo_notice_messages ?) * Raise a warning (using the warnings module) when a warning messages is found

I'm not sure if raising a warning is the right thing to do. The important thing is that warning messages are well visible.

Comments (6)

  1. Mike Bayer repo owner

    id like to see a patch on this one. A ConnectionProxy could also provide this functionality too but thats more of an "add on" approach (a flag in the PG dialect is fine).

  2. Log in to comment