Diff
Modified: trunk/docs/contents/changelog.rst (976 => 977)
--- trunk/docs/contents/changelog.rst 2019-04-20 11:54:07 UTC (rev 976)
+++ trunk/docs/contents/changelog.rst 2019-04-20 12:40:21 UTC (rev 977)
@@ -121,13 +121,14 @@
and use less memory. Also, overhead for quoting values in the DB wrapper
methods has been reduced and security has been improved by passing the
values to libpq separately as parameters instead of inline.
- - It is now possible to use regular type names instead of the simpler
- type names that are used by default in PyGreSQL, without breaking any
- of the mechanisms for quoting and typecasting, which rely on the type
- information. This is achieved while maintaining simplicity and backward
- compatibility by augmenting the type name string objects with all the
- necessary information under the cover. To switch regular type names on
- or off (this is the default), call the DB wrapper method use_regtypes().
+ - It is now possible to use the registered type names instead of the
+ more coarse-grained type names that are used by default in PyGreSQL,
+ without breaking any of the mechanisms for quoting and typecasting,
+ which rely on the type information. This is achieved while maintaining
+ simplicity and backward compatibility by augmenting the type name string
+ objects with all the necessary information under the cover. To switch
+ registered type names on or off (this is the default), call the DB
+ wrapper method use_regtypes().
- A new method query_formatted() has been added to the DB wrapper class
that allows using the format specifications from Python. A flag "inline"
can be set to specify whether parameters should be sent to the database
@@ -283,7 +284,7 @@
- Connections and cursors can now be used with the "with" statement
(as suggested by Peter Harris, see #46).
- New method use_regtypes() that can be called to let getattnames()
- return regular type names instead of the simplified classic types (#44).
+ return registered type names instead of the simplified classic types (#44).
Version 4.0 (2009-01-01)
------------------------
Modified: trunk/docs/contents/pg/db_types.rst (976 => 977)
--- trunk/docs/contents/pg/db_types.rst 2019-04-20 11:54:07 UTC (rev 976)
+++ trunk/docs/contents/pg/db_types.rst 2019-04-20 12:40:21 UTC (rev 977)
@@ -11,15 +11,16 @@
internal type names and type OIDs to PyGreSQL "type names" (which are also
returned by :meth:`DB.get_attnames` as dictionary values).
-These type names are strings which are equal to the simple PyGreSQL name or
-to regular type names if these have been enabled with :meth:`DB.use_regtypes`.
-Besides being strings, they are also carrying additional information about the
-associated PostgreSQL type in the following attributes:
+These type names are strings which are equal to either the simple PyGreSQL
+names or to the more fine-grained registered PostgreSQL type names if these
+have been enabled with :meth:`DB.use_regtypes`. Besides being strings, they
+carry additional information about the associated PostgreSQL type in the
+following attributes:
- *oid* -- the PostgreSQL type OID
- - *pgtype* -- the PostgreSQL type name
- - *regtype* -- the regular type name
- - *simple* -- the simple PyGreSQL type name
+ - *pgtype* -- the internal PostgreSQL data type name
+ - *regtype* -- the registered PostgreSQL data type name
+ - *simple* -- the more coarse-grained PyGreSQL type name
- *typtype* -- `b` = base type, `c` = composite type etc.
- *category* -- `A` = Array, `b` =Boolean, `C` = Composite etc.
- *delim* -- delimiter for array types
Modified: trunk/docs/contents/pg/db_wrapper.rst (976 => 977)
--- trunk/docs/contents/pg/db_wrapper.rst 2019-04-20 11:54:07 UTC (rev 976)
+++ trunk/docs/contents/pg/db_wrapper.rst 2019-04-20 12:40:21 UTC (rev 977)
@@ -134,7 +134,7 @@
in the proper order if you iterate over it.
By default, only a limited number of simple types will be returned.
-You can get the regular types instead, if enabled by calling the
+You can get the registered types instead, if enabled by calling the
:meth:`DB.use_regtypes` method.
has_table_privilege -- check table privilege
@@ -913,22 +913,22 @@
.. versionadded:: 5.0
-use_regtypes -- determine use of regular type names
----------------------------------------------------
+use_regtypes -- choose usage of registered type names
+-----------------------------------------------------
.. method:: DB.use_regtypes([regtypes])
- Determine whether regular type names shall be used
+ Determine whether registered type names shall be used
- :param bool regtypes: if passed, set whether regular type names shall be used
- :returns: whether regular type names are used
+ :param bool regtypes: if passed, set whether registered type names shall be used
+ :returns: whether registered type names are used
The :meth:`DB.get_attnames` method can return either simplified "classic"
-type names (the default) or more specific "regular" type names. Which kind
-of type names is used can be changed by calling :meth:`DB.get_regtypes`.
-If you pass a boolean, it sets whether regular type names shall be used.
-The method can also be used to check through its return value whether
-regular type names are currently used.
+type names (the default) or more fine-grained "registered" type names.
+Which kind of type names is used can be changed by calling
+:meth:`DB.get_regtypes`. If you pass a boolean, it sets whether registered
+type names shall be used. The method can also be used to check through its
+return value whether registered type names are currently used.
.. versionadded:: 4.1
Modified: trunk/pg.py (976 => 977)
--- trunk/pg.py 2019-04-20 11:54:07 UTC (rev 976)
+++ trunk/pg.py 2019-04-20 12:40:21 UTC (rev 977)
@@ -1157,9 +1157,9 @@
The following additional information is provided:
oid: the PostgreSQL type OID
- pgtype: the PostgreSQL type name
- regtype: the regular type name
- simple: the simple PyGreSQL type name
+ pgtype: the internal PostgreSQL data type name
+ regtype: the registered PostgreSQL data type name
+ simple: the more coarse-grained PyGreSQL type name
typtype: b = base type, c = composite type etc.
category: A = Array, b = Boolean, C = Composite etc.
delim: delimiter for array types
@@ -2048,7 +2048,7 @@
the search path has been changed.
By default, only a limited number of simple types will be returned.
- You can get the regular types after calling use_regtypes(True).
+ You can get the registered types after calling use_regtypes(True).
"""
attnames = self._attnames
if flush:
@@ -2069,7 +2069,7 @@
return names
def use_regtypes(self, regtypes=None):
- """Use regular type names instead of simplified type names."""
+ """Use registered type names instead of simplified type names."""
if regtypes is None:
return self.dbtypes._regtypes
else: