>From c5a9ca98342dd032996b1c138cf414bf1b64f460 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Date: Wed, 18 Feb 2015 15:42:54 +0900
Subject: [PATCH 4/4] Documentation for new OID alias types.

Added description about regrole and regnamespace and modified some
existing descriptions according to the restriction of these new
types. Addition to it, put a note about MVCC violation and
optimization issues.
---
 doc/src/sgml/datatype.sgml | 54 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 40 insertions(+), 14 deletions(-)

diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index edf636b..78a70ee 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -4319,7 +4319,8 @@ SET xmloption TO { DOCUMENT | CONTENT };
     an object identifier.  There are also several alias types for
     <type>oid</>: <type>regproc</>, <type>regprocedure</>,
     <type>regoper</>, <type>regoperator</>, <type>regclass</>,
-    <type>regtype</>, <type>regconfig</>, and <type>regdictionary</>.
+    <type>regtype</>, <type>regrole</>, <type>regnamespace</>, 
+    <type>regconfig</>, and <type>regdictionary</>.
     <xref linkend="datatype-oid-table"> shows an overview.
    </para>
 
@@ -4429,6 +4430,20 @@ SELECT * FROM pg_attribute
        </row>
 
        <row>
+        <entry><type>regrole</></entry>
+        <entry><structname>pg_authid</></entry>
+        <entry>role name</entry>
+        <entry><literal>John</></entry>
+       </row>
+
+       <row>
+        <entry><type>regnamespace</></entry>
+        <entry><structname>pg_namespace</></entry>
+        <entry>namespace name</entry>
+        <entry><literal>pg_catalog</></entry>
+       </row>
+
+       <row>
         <entry><type>regconfig</></entry>
         <entry><structname>pg_ts_config</></entry>
         <entry>text search configuration</entry>
@@ -4446,30 +4461,41 @@ SELECT * FROM pg_attribute
     </table>
 
    <para>
-    All of the OID alias types accept schema-qualified names, and will
-    display schema-qualified names on output if the object would not
-    be found in the current search path without being qualified.
-    The <type>regproc</> and <type>regoper</> alias types will only
-    accept input names that are unique (not overloaded), so they are
-    of limited use; for most uses <type>regprocedure</> or
+    All of the OID alias types for objects grouped by namespace accept
+    schema-qualified names, and will display schema-qualified names on output
+    if the object would not be found in the current search path without being
+    qualified.  The <type>regproc</> and <type>regoper</> alias types will
+    only accept input names that are unique (not overloaded), so they are of
+    limited use; for most uses <type>regprocedure</> or
     <type>regoperator</> are more appropriate.  For <type>regoperator</>,
     unary operators are identified by writing <literal>NONE</> for the unused
     operand.
    </para>
 
    <para>
-    An additional property of the OID alias types is the creation of
-    dependencies.  If a
-    constant of one of these types appears in a stored expression
-    (such as a column default expression or view), it creates a dependency
-    on the referenced object.  For example, if a column has a default
-    expression <literal>nextval('my_seq'::regclass)</>,
+    An additional property of most of the OID alias types is the creation of
+    dependencies.  If a constant of one of these types appears in a stored
+    expression (such as a column default expression or view), it creates a
+    dependency on the referenced object.  For example, if a column has a
+    default expression <literal>nextval('my_seq'::regclass)</>,
     <productname>PostgreSQL</productname>
     understands that the default expression depends on the sequence
     <literal>my_seq</>; the system will not let the sequence be dropped
-    without first removing the default expression.
+    without first removing the default expression. <type>regrole</>
+    and <type>regnamespace</> are the exceptions for the property. Constants
+    of these types are not allowed in such expressions.
    </para>
 
+   <note>
+   <para>
+     The OID alias types don't sctrictly comply the transaction isolation
+     rules so do not use them where exact transaction isolation on the values
+     of theses types has a significance. Likewise, since they look as simple
+     constants to planner so you might get slower plans than the queries
+     joining the system tables correnspond to the OID types.
+   </para>
+   </note>
+
    <para>
     Another identifier type used by the system is <type>xid</>, or transaction
     (abbreviated <abbrev>xact</>) identifier.  This is the data type of the system columns
-- 
2.1.0.GIT

