On Nov 16, 2007, at 1:54 PM, Manlio Perillo wrote:
> There is an error in the schema, b.id is of type String instead of > type > Integer. > > Unfortunately PostgreSQL does not raises an error, but just a warning. > > In fact I have found such a problem in one of my programs only after a > pg_dump + pg_restore: > > WARNING: foreign key constraint "b_id_fkey" will require costly > sequential scans > DETAIL: Key columns "id" and "id" are of different types: text and > integer. > > > What's the best method to avoid these bugs? > > It would be nice to have something like `salint`, that can scan a > metadata searching for problems. > > Also, it would help if PostgreSQL warnings messages can be reported by > psycopg/SQLAlchemy. > Better if warnings can be considered like errors, thus raising an > exception (something like the Werror option in GCC). if the warning is issued by Psycopg2, you can turn warnings into exceptions using the warnings filter, http://www.python.org/doc/lib/warning-filter.html . If its not, then SA can't do anything about it, you'd have to post on the psycopg2 list for this behavior to be supported. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---