Changeset 806 for trunk/docs


Ignore:
Timestamp:
Feb 1, 2016, 1:38:05 AM (3 years ago)
Author:
cito
Message:

Return bools from Postgres as Python bools by default

This has been done by the DB-API 2 module already and was configurable
in the classic module since a long time, but by default it was disabled.
It is now time to flip the switch and have this activated by default in
version 5.0. You can still restore the old behavior with set_bool(False).

Location:
trunk/docs/contents
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/contents/changelog.rst

    r804 r806  
    5656    - The pkey() method of the classic interface now returns tuples instead
    5757      of frozenset. The order of the tuples is like in the primary key index.
     58    - Like the DB-API 2 module, the classic module now also returns bool values
     59      from the database as Python bool objects instead of strings.  You can
     60      still restore the old behavior by calling set_bool(False).
    5861    - Like the DB-API 2 module, the classic module now also returns bytea
    59       columns fetched from the database as byte strings, so you don't need to
     62      data fetched from the database as byte strings, so you don't need to
    6063      call unescape_bytea() any more.  This has been made configurable though,
    6164      and you can restore the old behavior by calling set_bytea_escaped(True).
  • trunk/docs/contents/pg/module.rst

    r804 r806  
    409409This function checks whether PyGreSQL returns PostgreSQL boolean
    410410values converted to Python bool objects, or as ``'f'`` and ``'t'``
    411 strings which are the values used internally by PostgreSQL. By default,
    412 conversion to bool objects is not activated, but you can enable
    413 this with the :func:`set_bool` function.
     411strings which are the values used internally by PostgreSQL.  By default,
     412conversion to bool objects is activated, but you can disable this with
     413the :func:`set_bool` function.
    414414
    415415.. versionadded:: 4.2
     
    423423This function can be used to specify whether PyGreSQL shall return
    424424PostgreSQL boolean values converted to Python bool objects, or as
    425 ``'f'`` and ``'t'`` strings which are the values used internally by PostgreSQL.
    426 By default, conversion to bool objects is not activated, but you can
    427 enable this by calling ``set_bool(True)``.
     425``'f'`` and ``'t'`` strings which are the values used internally by
     426PostgreSQL.  By default, conversion to bool objects is activated,
     427but you can disable this by calling ``set_bool(True)``.
    428428
    429429.. versionadded:: 4.2
     430
     431.. versionchanged:: 5.0
     432   Boolean values had been returned as string by default in earlier versions.
    430433
    431434get/set_array -- whether arrays are returned as list objects
     
    460463
    461464.. versionchanged:: 5.0
    462    Arrays had been returned as text strings only in earlier versions.
     465   Arrays had been always returned as text strings only in earlier versions.
    463466
    464467get/set_bytea_escaped -- whether bytea data is returned escaped
     
    493496
    494497.. versionchanged:: 5.0
    495    Bytea data had been returned in escaped form in earlier versions.
     498   Bytea data had been returned in escaped form by default in earlier versions.
    496499
    497500get/set_jsondecode -- decoding JSON format
     
    520523
    521524.. versionchanged:: 5.0
    522    JSON data had been returned in as text strings in earlier versions.
     525   JSON data had been always returned as text strings in earlier versions.
    523526
    524527get/set_cast_hook -- fallback typecast function
Note: See TracChangeset for help on using the changeset viewer.