aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/sgml/ref')
-rw-r--r--doc/src/sgml/ref/alter_sequence.sgml31
-rw-r--r--doc/src/sgml/ref/alter_view.sgml68
2 files changed, 79 insertions, 20 deletions
diff --git a/doc/src/sgml/ref/alter_sequence.sgml b/doc/src/sgml/ref/alter_sequence.sgml
index 7cf69e9ea3f..739f3ec0f84 100644
--- a/doc/src/sgml/ref/alter_sequence.sgml
+++ b/doc/src/sgml/ref/alter_sequence.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/alter_sequence.sgml,v 1.21 2008/05/17 01:20:39 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/alter_sequence.sgml,v 1.22 2008/06/15 01:25:53 tgl Exp $
PostgreSQL documentation
-->
@@ -30,6 +30,7 @@ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> [ INCREMENT [ B
[ RESTART [ [ WITH ] <replaceable class="parameter">restart</replaceable> ] ]
[ CACHE <replaceable class="parameter">cache</replaceable> ] [ [ NO ] CYCLE ]
[ OWNED BY { <replaceable class="parameter">table</replaceable>.<replaceable class="parameter">column</replaceable> | NONE } ]
+ALTER SEQUENCE <replaceable class="parameter">name</replaceable> OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
ALTER SEQUENCE <replaceable class="parameter">name</replaceable> RENAME TO <replaceable class="parameter">new_name</replaceable>
ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <replaceable class="parameter">new_schema</replaceable>
</synopsis>
@@ -48,6 +49,11 @@ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <rep
You must own the sequence to use <command>ALTER SEQUENCE</>.
To change a sequence's schema, you must also have <literal>CREATE</>
privilege on the new schema.
+ To alter the owner, you must also be a direct or indirect member of the new
+ owning role, and that role must have <literal>CREATE</literal> privilege on
+ the sequence's schema. (These restrictions enforce that altering the owner
+ doesn't do anything you couldn't do by dropping and recreating the sequence.
+ However, a superuser can alter ownership of any sequence anyway.)
</para>
</refsect1>
@@ -206,6 +212,15 @@ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <rep
</varlistentry>
<varlistentry>
+ <term><replaceable class="PARAMETER">new_owner</replaceable></term>
+ <listitem>
+ <para>
+ The user name of the new owner of the sequence.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><replaceable class="parameter">new_name</replaceable></term>
<listitem>
<para>
@@ -233,9 +248,9 @@ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <rep
<para>
To avoid blocking of concurrent transactions that obtain numbers from the
same sequence, <command>ALTER SEQUENCE</command>'s effects on the sequence
- generation parameters are never rolled back;
- those changes take effect immediately and are not reversible. However,
- the <literal>OWNED BY</>, <literal>RENAME</>, and <literal>SET SCHEMA</>
+ generation parameters are never rolled back; those changes take effect
+ immediately and are not reversible. However, the <literal>OWNED BY</>,
+ <literal>OWNER TO</>, <literal>RENAME TO</>, and <literal>SET SCHEMA</>
clauses cause ordinary catalog updates that can be rolled back.
</para>
@@ -255,9 +270,9 @@ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <rep
</para>
<para>
- Some variants of <command>ALTER TABLE</command> can be used with
- sequences as well; for example, to rename a sequence it is also
- possible to use <command>ALTER TABLE RENAME</command>.
+ For historical reasons, <command>ALTER TABLE</command> can be used with
+ sequences too; but the only variants of <command>ALTER TABLE</command>
+ that are allowed with sequences are equivalent to the forms shown above.
</para>
</refsect1>
@@ -278,7 +293,7 @@ ALTER SEQUENCE serial RESTART WITH 105;
<para>
<command>ALTER SEQUENCE</command> conforms to the <acronym>SQL</acronym>
standard, except for the <literal>START WITH</>,
- <literal>OWNED BY</>, <literal>RENAME</>, and
+ <literal>OWNED BY</>, <literal>OWNER TO</>, <literal>RENAME TO</>, and
<literal>SET SCHEMA</literal> clauses, which are
<productname>PostgreSQL</productname> extensions.
</para>
diff --git a/doc/src/sgml/ref/alter_view.sgml b/doc/src/sgml/ref/alter_view.sgml
index 7dd052cc124..4c3d9a2479f 100644
--- a/doc/src/sgml/ref/alter_view.sgml
+++ b/doc/src/sgml/ref/alter_view.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/alter_view.sgml,v 1.3 2007/10/03 16:48:43 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/alter_view.sgml,v 1.4 2008/06/15 01:25:53 tgl Exp $
PostgreSQL documentation
-->
@@ -20,7 +20,11 @@ PostgreSQL documentation
<refsynopsisdiv>
<synopsis>
-ALTER VIEW <replaceable>name</replaceable> RENAME TO <replaceable>newname</replaceable>
+ALTER VIEW <replaceable class="parameter">name</replaceable> ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> SET DEFAULT <replaceable class="PARAMETER">expression</replaceable>
+ALTER VIEW <replaceable class="parameter">name</replaceable> ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> DROP DEFAULT
+ALTER VIEW <replaceable class="parameter">name</replaceable> OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
+ALTER VIEW <replaceable class="parameter">name</replaceable> RENAME TO <replaceable class="parameter">new_name</replaceable>
+ALTER VIEW <replaceable class="parameter">name</replaceable> SET SCHEMA <replaceable class="parameter">new_schema</replaceable>
</synopsis>
</refsynopsisdiv>
@@ -28,9 +32,20 @@ ALTER VIEW <replaceable>name</replaceable> RENAME TO <replaceable>newname</repla
<title>Description</title>
<para>
- <command>ALTER VIEW</command> changes the definition of a view.
- The only currently available functionality is to rename the view.
- To execute this command you must be the owner of the view.
+ <command>ALTER VIEW</command> changes various auxiliary properties
+ of a view. (If you want to modify the view's defining query,
+ use <command>CREATE OR REPLACE VIEW</>.)
+ </para>
+
+ <para>
+ You must own the view to use <command>ALTER VIEW</>.
+ To change a view's schema, you must also have <literal>CREATE</>
+ privilege on the new schema.
+ To alter the owner, you must also be a direct or indirect member of the new
+ owning role, and that role must have <literal>CREATE</literal> privilege on
+ the view's schema. (These restrictions enforce that altering the owner
+ doesn't do anything you couldn't do by dropping and recreating the view.
+ However, a superuser can alter ownership of any view anyway.)
</para>
</refsect1>
@@ -48,10 +63,41 @@ ALTER VIEW <replaceable>name</replaceable> RENAME TO <replaceable>newname</repla
</varlistentry>
<varlistentry>
- <term><replaceable class="parameter">newname</replaceable></term>
+ <term><literal>SET</literal>/<literal>DROP DEFAULT</literal></term>
+ <listitem>
+ <para>
+ These forms set or remove the default value for a column.
+ A default value associated with a view column is
+ inserted into <command>INSERT</> statements on the view before
+ the view's <literal>ON INSERT</literal> rule is applied, if
+ the <command>INSERT</> does not specify a value for the column.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="PARAMETER">new_owner</replaceable></term>
+ <listitem>
+ <para>
+ The user name of the new owner of the view.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">new_name</replaceable></term>
+ <listitem>
+ <para>
+ The new name for the view.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">new_schema</replaceable></term>
<listitem>
<para>
- The new name of the view.
+ The new schema for the view.
</para>
</listitem>
</varlistentry>
@@ -62,11 +108,9 @@ ALTER VIEW <replaceable>name</replaceable> RENAME TO <replaceable>newname</repla
<title>Notes</title>
<para>
- Some variants of <command>ALTER TABLE</command> can be used with
- views as well; for example, to rename a view it is also
- possible to use <command>ALTER TABLE RENAME</command>. To change
- the schema or owner of a view, you currently must use <command>ALTER
- TABLE</>.
+ For historical reasons, <command>ALTER TABLE</command> can be used with
+ views too; but the only variants of <command>ALTER TABLE</command>
+ that are allowed with views are equivalent to the ones shown above.
</para>
</refsect1>