Changeset 977 for trunk


Ignore:
Timestamp:
Apr 20, 2019, 8:40:21 AM (7 months ago)
Author:
cito
Message:

Use the term "registered type" (not "regular" type)

This is the actual meaning of "regtype" in PostgreSQL.

Location:
trunk
Files:
4 edited

Legend:

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

    r968 r977  
    122122      methods has been reduced and security has been improved by passing the
    123123      values to libpq separately as parameters instead of inline.
    124     - It is now possible to use regular type names instead of the simpler
    125       type names that are used by default in PyGreSQL, without breaking any
    126       of the mechanisms for quoting and typecasting, which rely on the type
    127       information. This is achieved while maintaining simplicity and backward
    128       compatibility by augmenting the type name string objects with all the
    129       necessary information under the cover. To switch regular type names on
    130       or off (this is the default), call the DB wrapper method use_regtypes().
     124    - It is now possible to use the registered type names instead of the
     125      more coarse-grained type names that are used by default in PyGreSQL,
     126      without breaking any of the mechanisms for quoting and typecasting,
     127      which rely on the type information. This is achieved while maintaining
     128      simplicity and backward compatibility by augmenting the type name string
     129      objects with all the necessary information under the cover. To switch
     130      registered type names on or off (this is the default), call the DB
     131      wrapper method use_regtypes().
    131132    - A new method query_formatted() has been added to the DB wrapper class
    132133      that allows using the format specifications from Python.  A flag "inline"
     
    284285  (as suggested by Peter Harris, see #46).
    285286- New method use_regtypes() that can be called to let getattnames()
    286   return regular type names instead of the simplified classic types (#44).
     287  return registered type names instead of the simplified classic types (#44).
    287288
    288289Version 4.0 (2009-01-01)
  • trunk/docs/contents/pg/db_types.rst

    r962 r977  
    1212returned by :meth:`DB.get_attnames` as dictionary values).
    1313
    14 These type names are strings which are equal to the simple PyGreSQL name or
    15 to regular type names if these have been enabled with :meth:`DB.use_regtypes`.
    16 Besides being strings, they are also carrying additional information about the
    17 associated PostgreSQL type in the following attributes:
     14These type names are strings which are equal to either the simple PyGreSQL
     15names or to the more fine-grained registered PostgreSQL type names if these
     16have been enabled with :meth:`DB.use_regtypes`. Besides being strings, they
     17carry additional information about the associated PostgreSQL type in the
     18following attributes:
    1819
    1920        - *oid* -- the PostgreSQL type OID
    20         - *pgtype* -- the PostgreSQL type name
    21         - *regtype* -- the regular type name
    22         - *simple* -- the simple PyGreSQL type name
     21        - *pgtype* -- the internal PostgreSQL data type name
     22        - *regtype* -- the registered PostgreSQL data type name
     23        - *simple* -- the more coarse-grained PyGreSQL type name
    2324        - *typtype* -- `b` = base type, `c` = composite type etc.
    2425        - *category* -- `A` = Array, `b` =Boolean, `C` = Composite etc.
  • trunk/docs/contents/pg/db_wrapper.rst

    r973 r977  
    135135
    136136By default, only a limited number of simple types will be returned.
    137 You can get the regular types instead, if enabled by calling the
     137You can get the registered types instead, if enabled by calling the
    138138:meth:`DB.use_regtypes` method.
    139139
     
    914914.. versionadded:: 5.0
    915915
    916 use_regtypes -- determine use of regular type names
    917 ---------------------------------------------------
     916use_regtypes -- choose usage of registered type names
     917-----------------------------------------------------
    918918
    919919.. method:: DB.use_regtypes([regtypes])
    920920
    921     Determine whether regular type names shall be used
    922 
    923     :param bool regtypes: if passed, set whether regular type names shall be used
    924     :returns: whether regular type names are used
     921    Determine whether registered type names shall be used
     922
     923    :param bool regtypes: if passed, set whether registered type names shall be used
     924    :returns: whether registered type names are used
    925925
    926926The :meth:`DB.get_attnames` method can return either simplified "classic"
    927 type names (the default) or more specific "regular" type names. Which kind
    928 of type names is used can be changed by calling :meth:`DB.get_regtypes`.
    929 If you pass a boolean, it sets whether regular type names shall be used.
    930 The method can also be used to check through its return value whether
    931 regular type names are currently used.
     927type names (the default) or more fine-grained "registered" type names.
     928Which kind of type names is used can be changed by calling
     929:meth:`DB.get_regtypes`. If you pass a boolean, it sets whether registered
     930type names shall be used. The method can also be used to check through its
     931return value whether registered type names are currently used.
    932932
    933933.. versionadded:: 4.1
  • trunk/pg.py

    r974 r977  
    11581158
    11591159        oid: the PostgreSQL type OID
    1160         pgtype: the PostgreSQL type name
    1161         regtype: the regular type name
    1162         simple: the simple PyGreSQL type name
     1160        pgtype: the internal PostgreSQL data type name
     1161        regtype: the registered PostgreSQL data type name
     1162        simple: the more coarse-grained PyGreSQL type name
    11631163        typtype: b = base type, c = composite type etc.
    11641164        category: A = Array, b = Boolean, C = Composite etc.
     
    20492049
    20502050        By default, only a limited number of simple types will be returned.
    2051         You can get the regular types after calling use_regtypes(True).
     2051        You can get the registered types after calling use_regtypes(True).
    20522052        """
    20532053        attnames = self._attnames
     
    20702070
    20712071    def use_regtypes(self, regtypes=None):
    2072         """Use regular type names instead of simplified type names."""
     2072        """Use registered type names instead of simplified type names."""
    20732073        if regtypes is None:
    20742074            return self.dbtypes._regtypes
Note: See TracChangeset for help on using the changeset viewer.