sqlite3, OperationalError: no such column, shouldn't that ne a ProgrammingError?

Gabriel Rossetti gabriel.rossetti at arimaz.com
Tue Jun 16 17:41:08 CEST 2009


Hello everyone,

I get an OperationalError with sqlite3 if I put the wrong column name, 
but shouldn't that be a ProgrammingError instead? I read PEP 249 and it 
says :

"        OperationalError
         
            Exception raised for errors that are related to the
            database's operation and not necessarily under the control
            of the programmer, e.g. an unexpected disconnect occurs,
            the data source name is not found, a transaction could not
            be processed, a memory allocation error occurred during
            processing, etc.  It must be a subclass of DatabaseError.
           
        ProgrammingError
         
            Exception raised for programming errors, e.g. table not
            found or already exists, syntax error in the SQL
            statement, wrong number of parameters specified, etc.  It
            must be a subclass of DatabaseError.
"

and to me it sounds more like a programming error than an operational 
error.

Thank you,
Gabriel



More information about the Python-list mailing list