summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-02-16 02:54:30 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-02-16 02:54:30 +0000
commit3b10ef899840d5e8c64a765b008c25eb00095892 (patch)
tree4ad6e7c8b904f67859b1abd69af289208ae72e37
parentbccbcf42d0c33f1a94cad26647b220bd541179e7 (diff)
downloadpsycopg2-3b10ef899840d5e8c64a765b008c25eb00095892.tar.gz
Documentation about new support for binary objects improved
-rw-r--r--NEWS5
-rw-r--r--doc/src/usage.rst11
2 files changed, 12 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 5c752c6..5c5fa69 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 2f16a98..9f0c5db 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::