Code

Changes between Version 20 and Version 21 of BetterErrorMessages


Ignore:
Timestamp:
02/28/08 15:12:39 (6 years ago)
Author:
kcarnold
Comment:

Describe a confusing PostgreSQL error that I hit reasonably often

Legend:

Unmodified
Added
Removed
Modified
  • BetterErrorMessages

    v20 v21  
    6565}}} 
    6666 
     67This pyscopg2 (PostgreSQL) error usually signifies that some ''previous'' database query was incorrect (e.g., you tried to {{{order_by()}}} a field that doesn't exist, or put a string in an integer column, etc.). That previous error aborted the transaction, causing all subsequent database access to fail with this message. 
     68 
     69If you get this while at a shell, you can fix your database connection by executing a rollback: 
     70{{{ 
     71from django.db import connection 
     72connection.cursor().execute('rollback') 
     73}}} 
     74 
     75If you get this from a view, it probably means the immediately previous query had a problem (but was caught by an over-eager exception handler). 
     76 
    6777In certain situations with PostgreSQL, a bogus error message about SET TIME ZONE may be returned. See #3179 (which is closed, but has a description of the problem).  The real error message can probably be found in the postgres log file. 
    6878