Skip to content

Commit

Permalink
Send Python 3 strings as uknown type
Browse files Browse the repository at this point in the history
Also, add release notes.
  • Loading branch information
tlocke committed Jun 13, 2018
1 parent dfd2af1 commit 441e3da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions README.adoc
Expand Up @@ -3,7 +3,7 @@

pg8000 is a pure-link:http://www.python.org/[Python]
http://www.postgresql.org/[PostgreSQL] driver that complies with
http://www.python.org/dev/peps/pep-0249/[DB-API 2.0]. It runs on Python versions 2.7+ and 3.3+, on CPython, Jython and PyPy. Pg8000's name comes from
http://www.python.org/dev/peps/pep-0249/[DB-API 2.0]. It runs on Python versions 2.7+ and 3.4+, on CPython and PyPy. Pg8000's name comes from
the belief that it is probably about the 8000th PostgreSQL interface for
Python. pg8000 is distributed under the terms of the BSD 3-clause license.

Expand Down Expand Up @@ -281,7 +281,8 @@ XML types.

| JSON
| json, jsonb
| Use the pg8000.PGJson and pg8000.PGJsonb wrappers. Results returned as
| The Python JSON can be provided as a Python serialized string, or wrapped in
pg8000.PGJson and pg8000.PGJsonb wrappers. Results returned as
de-serialized JSON.
|===

Expand Down Expand Up @@ -1101,6 +1102,17 @@ python setup.py sdist bdist_wheel upload --sign
== Release Notes


=== Version 1.12.1, 2018-06-12


* Revert back to the Python 3 `str` type being sent as an `unknown` type,
rather than the `text` type as it was in the previous release. The reason is
that with the `unknown` type there's the convenience of using a plain Python
string for JSON, Enum etc. There's always the option of using the
`pg8000.PGJson` and `pg8000.PGEnum` wrappers if precise control over the
PostgreSQL type is needed.


=== Version 1.12.0, 2018-06-12

Note that this version is not backward compatible with previous versions.
Expand Down
2 changes: 1 addition & 1 deletion pg8000/core.py
Expand Up @@ -1372,7 +1372,7 @@ def numeric_out(d):
self.inspect_funcs[long] = self.inspect_int # noqa
else:
self.py_types[bytes] = (17, FC_BINARY, bytea_send) # bytea
self.py_types[str] = (25, FC_TEXT, text_out) # str
self.py_types[str] = (705, FC_TEXT, text_out) # unknown

try:
import enum
Expand Down

0 comments on commit 441e3da

Please sign in to comment.