diff --git a/NEWS b/NEWS index 5c752c6f..5c5fa69e 100644 --- a/NEWS +++ b/NEWS @@ -4,8 +4,9 @@ What's new in psycopg 2.4 * New features and changes: - Added support for Python 3.1 and 3.2. - - Adapt types 'bytearray' (from Python 2.6) and 'memoryview' (from Python - 2.7) to bytea data type. + - Adapt types 'bytearray' (from Python 2.6), 'memoryview' (from Python 2.7) + and other objects implementing the 'Revised Buffer Protocol' to bytea data + type. - Added `register_composite()` function to cast PostgreSQL composite types into Python tuples/namedtuples. - More efficient iteration on named cursors. diff --git a/doc/src/usage.rst b/doc/src/usage.rst index 2f16a982..9f0c5db6 100644 --- a/doc/src/usage.rst +++ b/doc/src/usage.rst @@ -254,8 +254,15 @@ the SQL string that would be sent to the database. types are `!buffer` (only available in Python 2), `!memoryview` (available from Python 2.7), `!bytearray` (available from Python 2.6) and `!bytes` (only form Python 3: the name is available from Python 2.6 but it's only an - alias for the type `!str`). Received data is returned as `!buffer` (in - Python 2) or `!memoryview` (in Python 3). + alias for the type `!str`). Any object implementing the `Revised Buffer + Protocol`__ should be usable as binary type where the protocol is supported + (i.e. from Python 2.6). Received data is returned as `!buffer` (in Python 2) + or `!memoryview` (in Python 3). + + .. __: http://www.python.org/dev/peps/pep-3118/ + + .. versionchanged:: 2.4 + only strings were supported before. .. note::