alter_type.sgml
来自「postgresql8.3.4源码,开源数据库」· SGML 代码 · 共 119 行
SGML
119 行
<!--$PostgreSQL: pgsql/doc/src/sgml/ref/alter_type.sgml,v 1.4 2006/09/16 00:30:16 momjian Exp $PostgreSQL documentation--><refentry id="SQL-ALTERTYPE"> <refmeta> <refentrytitle id="sql-altertype-title">ALTER TYPE</refentrytitle> <refmiscinfo>SQL - Language Statements</refmiscinfo> </refmeta> <refnamediv> <refname> ALTER TYPE </refname> <refpurpose> change the definition of a type </refpurpose> </refnamediv> <indexterm zone="sql-altertype"> <primary>ALTER TYPE</primary> </indexterm> <refsynopsisdiv> <synopsis>ALTER TYPE <replaceable class="PARAMETER">name</replaceable> OWNER TO <replaceable class="PARAMETER">new_owner</replaceable> ALTER TYPE <replaceable class="PARAMETER">name</replaceable> SET SCHEMA <replaceable class="PARAMETER">new_schema</replaceable> </synopsis> </refsynopsisdiv> <refsect1> <title>Description</title> <para> <command>ALTER TYPE</command> changes the definition of an existing type. The only currently available capabilities are changing the owner and schema of a type. </para> <para> You must own the type to use <command>ALTER TYPE</>. To change the schema of a type, you must also have <literal>CREATE</literal> 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 type's schema. (These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the type. However, a superuser can alter ownership of any type anyway.) </para> </refsect1> <refsect1> <title>Parameters</title> <para> <variablelist> <varlistentry> <term><replaceable class="PARAMETER">name</replaceable></term> <listitem> <para> The name (possibly schema-qualified) of an existing type to alter. </para> </listitem> </varlistentry> <varlistentry> <term><replaceable class="PARAMETER">new_owner</replaceable></term> <listitem> <para> The user name of the new owner of the type. </para> </listitem> </varlistentry> <varlistentry> <term><replaceable class="PARAMETER">new_schema</replaceable></term> <listitem> <para> The new schema for the type. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1> <title>Examples</title> <para> To change the owner of the user-defined type <literal>email</literal> to <literal>joe</literal>: <programlisting>ALTER TYPE email OWNER TO joe; </programlisting> </para> <para> To change the schema of the user-defined type <literal>email</literal> to <literal>customers</literal>: <programlisting>ALTER TYPE email SET SCHEMA customers; </programlisting> </para> </refsect1> <refsect1> <title>Compatibility</title> <para> There is no <command>ALTER TYPE</command> statement in the SQL standard. </para> </refsect1></refentry>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?