Changeset 751 for trunk/docs


Ignore:
Timestamp:
Jan 15, 2016, 10:23:38 AM (4 years ago)
Author:
cito
Message:

Mention the SQLSTATE error code in the pgdb docs

Location:
trunk/docs/contents
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/contents/pg/connection.rst

    r735 r751  
    6262
    6363When the database could not process the query, a :exc:`pg.ProgrammingError` or
    64 a :exc:`pg.InternalError` is raised. You can check the ``SQLSTATE`` code of
    65 this error by reading its :attr:`sqlstate` attribute.
     64a :exc:`pg.InternalError` is raised. You can check the ``SQLSTATE`` error code
     65of this error by reading its :attr:`sqlstate` attribute.
    6666
    6767Example::
  • trunk/docs/contents/pgdb/cursor.rst

    r710 r751  
    9696rows in a single operation, but this kind of usage is deprecated:
    9797:meth:`Cursor.executemany` should be used instead.
     98
     99Note that in case this method raises a :exception:`DatabaseError`, you can
     100get information about the error condition that has occurred by introspecting
     101its :attr:`DatabaseError.sqlstate` attribute, which will be the ``SQLSTATE``
     102error code associated with the error.  Applications that need to know which
     103error condition has occurred should usually test the error code, rather than
     104looking at the textual error message.
    98105
    99106executemany -- execute many similar database operations
  • trunk/docs/contents/pgdb/module.rst

    r710 r751  
    8282    Exception raised for errors that are related to the database.
    8383
     84    In PyGreSQL, this also has a :attr:`DatabaseError.sqlstate` attribute
     85    that contains the ``SQLSTATE`` error code of this error.
     86
    8487.. exception:: DataError
    8588
Note: See TracChangeset for help on using the changeset viewer.