Changeset 791 for trunk/docs

Jan 27, 2016, 6:09:18 PM (4 years ago)

Add support for composite types

Added a fast parser for the composite type input/output syntax, which is
similar to the already existing parser for the array input/output syntax.

The pgdb module now makes use of this parser, converting in both directions
between PostgreSQL records (composite types) and Python (named) tuples.

1 edited


  • trunk/docs/contents/changelog.rst

    r782 r791  
    2626  The column names and types can now also be requested through the
    2727  colnames and coltypes attributes, which are not part of DB-API 2 though.
    28 - If you pass a list as one of the parameters to a DB-API 2 cursor, it is
    29   now automatically bound as PostgreSQL ARRAY. If you pass a tuple, then
    30   it will be bound as a PostgreSQL ROW expression.
     28- If you pass a Python list as one of the parameters to a DB-API 2 cursor,
     29  it is now automatically bound as a PostgreSQL array. If you pass a Python
     30  tuple, it is bound as a PostgreSQL composite type. Inversely, if a query
     31  returns a PostgreSQL array, it is passed to Python as a list, and if it
     32  returns a PostgreSQL composite type, it is passed to Python as a (named)
     33  tuple. PyGreSQL uses the special input and output syntax for PostgreSQL
     34  arrays and composite types in all of these cases. Anonymous composite
     35  types are returned as ordinary (unnamed) tuples with string values.
    3136- Re-activated the shortcut methods of the DB-API connection since they
    3237  can be handy when doing experiments or writing quick scripts. We keep
Note: See TracChangeset for help on using the changeset viewer.