Changeset 751


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

Mention the SQLSTATE error code in the pgdb docs

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/4.x/docs/contents/pg/connection.rst

    r736 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::
  • branches/4.x/docs/contents/pgdb/cursor.rst

    r708 r751  
    9292:meth:`pgdbCursor.executemany` should be used instead.
    9393
     94Note that in case this method raises a :exception:`DatabaseError`, you can
     95get information about the error condition that has occurred by introspecting
     96its :attr:`DatabaseError.sqlstate` attribute, which will be the ``SQLSTATE``
     97error code associated with the error.  Applications that need to know which
     98error condition has occurred should usually test the error code, rather than
     99looking at the textual error message.
     100
    94101executemany -- execute many similar database operations
    95102-------------------------------------------------------
  • branches/4.x/docs/contents/pgdb/module.rst

    r708 r751  
    8383    Exception raised for errors that are related to the database.
    8484
     85    In PyGreSQL, this also has a :attr:`DatabaseError.sqlstate` attribute
     86    that contains the ``SQLSTATE`` error code of this error.
     87
    8588.. exception:: DataError
    8689
  • 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.