1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Add new OID alias type regrole

The new type has the scope of whole the database cluster so it doesn't
behave the same as the existing OID alias types which have database
scope,
concerning object dependency. To avoid confusion constants of the new
type are prohibited from appearing where dependencies are made involving
it.

Also, add a note to the docs about possible MVCC violation and
optimization issues, which are general over the all reg* types.

Kyotaro Horiguchi
This commit is contained in:
Andrew Dunstan
2015-05-09 13:06:49 -04:00
parent 0cf56f14dd
commit 0c90f6769d
20 changed files with 235 additions and 31 deletions

View File

@ -4321,8 +4321,9 @@ 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</>.
<xref linkend="datatype-oid-table"> shows an overview.
<type>regtype</>, <type>regrole</>, <type>regconfig</>, and
<type>regdictionary</>. <xref linkend="datatype-oid-table"> shows
an overview.
</para>
<para>
@ -4430,6 +4431,13 @@ SELECT * FROM pg_attribute
<entry><literal>integer</></entry>
</row>
<row>
<entry><type>regrole</></entry>
<entry><structname>pg_authid</></entry>
<entry>role name</entry>
<entry><literal>smithee</></entry>
</row>
<row>
<entry><type>regconfig</></entry>
<entry><structname>pg_ts_config</></entry>
@ -4448,7 +4456,8 @@ SELECT * FROM pg_attribute
</table>
<para>
All of the OID alias types accept schema-qualified names, and will
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
@ -4460,7 +4469,7 @@ SELECT * FROM pg_attribute
</para>
<para>
An additional property of the OID alias types is the creation of
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
@ -4470,8 +4479,18 @@ SELECT * FROM pg_attribute
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.
<type>regrole</> is the only exception for the property. Constants of this
type are not allowed in such expressions.
</para>
<note>
<para>
The OID alias types do not completely follow transaction isolation
rules. The planner also treats them as simple constants, which may
result in sub-optimal planning.
</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