Changeset 857 for trunk/docs


Ignore:
Timestamp:
Mar 18, 2016, 8:22:21 AM (3 years ago)
Author:
cito
Message:

Add system parameter to get_relations()

Also fix a regression in the 4.x branch when using temporary tables,
related to filtering system tables (as discussed on the mailing list).

Location:
trunk/docs/contents
Files:
2 edited

Legend:

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

    r856 r857  
    133133      removed since it is not supported any more since PostgreSQL 7.4.
    134134
     135Version 4.2.2
     136-------------
     137- The get_relations() and get_tables() methods now also return system views
     138  and tables if you set the optional "system" parameter to True.
     139- Fixed a regression when using temporary tables with DB wrapper methods
     140  (thanks to Patrick TJ McPhee for reporting).
     141
    135142Version 4.2.1 (2016-02-18)
    136143--------------------------
  • trunk/docs/contents/pg/db_wrapper.rst

    r810 r857  
    8585------------------------------------------------------------
    8686
    87 .. method:: DB.get_relations(kinds)
     87.. method:: DB.get_relations([kinds], [system])
    8888
    8989    Get the list of relations in connected database
    9090
    9191    :param str kinds: a string or sequence of type letters
     92    :param bool system: whether system relations should be returned
    9293    :returns: all relations of the given kinds in the database
    9394    :rtype: list
    9495
    95 The type letters are ``r`` = ordinary table, ``i`` = index, ``S`` = sequence,
    96 ``v`` = view, ``c`` = composite type, ``s`` = special, ``t`` = TOAST table.
    97 If `kinds` is None or an empty string, all relations are returned (this is
    98 also the default). Although you can do this with a simple select, it is
    99 added here for convenience.
     96This method returns the list of relations in the connected database.  Although
     97you can do this with a simple select, it is added here for convenience.  You
     98can select which kinds of relations you are interested in by passing type
     99letters in the `kinds` parameter.  The type letters are ``r`` = ordinary table,
     100``i`` = index, ``S`` = sequence, ``v`` = view, ``c`` = composite type,
     101``s`` = special, ``t`` = TOAST table.  If `kinds` is None or an empty string,
     102all relations are returned (this is also the default).  If `system` is set to
     103`True`, then system tables and views (temporary tables, toast tables, catalog
     104vies and tables) will be returned as well, otherwise they will be ignored.
    100105
    101106get_tables -- get list of tables in connected database
    102107------------------------------------------------------
    103108
    104 .. method:: DB.get_tables()
     109.. method:: DB.get_tables([system])
    105110
    106111    Get the list of tables in connected database
    107112
     113    :param bool system: whether system tables should be returned
    108114    :returns: all tables in connected database
    109115    :rtype: list
    110116
    111 This is a shortcut for ``get_relations('r')`` that has been added for
     117This is a shortcut for ``get_relations('r', system)`` that has been added for
    112118convenience.
    113119
Note: See TracChangeset for help on using the changeset viewer.