Database engine detection fails with PostgreSQL

Issue #1 resolved
David Larlet
created an issue


It appears that engine detection lead to a DatabaseError in my environment for time_series.

The error raised is "current transaction is aborted, commands ignored until end of transaction block". If I comment the first test and directly run the _slow_time_series it doesn't raise any error.

Maybe you should check directly from settings to avoid the try/except part?


Comments (5)

  1. Mikhail Korobov repo owner
    • changed status to open

    Hi David,

    The database detection is now insanely stupid and should be rewritten for sure. It was only a hack to make tests run on sqlite. I haven't tested this with other DB engines.

    My production boxes are django 1.1 and 1.2 + mysql so I just cut corners and didn't implement the proper solution. I don't quite understand though why DatabaseError wasn't caught by try/except clause.

    The proper solution seems to be the following: use queryset's DB for django 1.2 and DB from settings for django 1.1.

  2. David Larlet reporter

    Hi Mikhail,

    You're right with the engine parameter, it works if I specify it. Thanks.

    I think the DatabaseError is not catched because the try makes the database connexion/transaction "unstable". It already happens to me but I can't remember in which case.

  3. Log in to comment