Home Explore Blog CI



postgresql

3rd chunk of `doc/src/sgml/ref/alter_type.sgml`
4ddccc49425b1fe11b78e37118ddc5890d7552169c5ccb830000000100000fa2
 <command>CREATE
      TYPE</command>.  Specifically, these properties can be changed:
      <itemizedlist>
       <listitem>
        <para>
         <literal>RECEIVE</literal> can be set to the name of a binary input
         function, or <literal>NONE</literal> to remove the type's binary
         input function.  Using this option requires superuser privilege.
        </para>
       </listitem>
       <listitem>
        <para>
         <literal>SEND</literal> can be set to the name of a binary output
         function, or <literal>NONE</literal> to remove the type's binary
         output function.  Using this option requires superuser privilege.
        </para>
       </listitem>
       <listitem>
        <para>
         <literal>TYPMOD_IN</literal> can be set to the name of a type
         modifier input function, or <literal>NONE</literal> to remove the
         type's type modifier input function.  Using this option requires
         superuser privilege.
        </para>
       </listitem>
       <listitem>
        <para>
         <literal>TYPMOD_OUT</literal> can be set to the name of a type
         modifier output function, or <literal>NONE</literal> to remove the
         type's type modifier output function.  Using this option requires
         superuser privilege.
        </para>
       </listitem>
       <listitem>
        <para>
         <literal>ANALYZE</literal> can be set to the name of a type-specific
         statistics collection function, or <literal>NONE</literal> to remove
         the type's statistics collection function.  Using this option
         requires superuser privilege.
        </para>
       </listitem>
       <listitem>
        <para>
         <literal>SUBSCRIPT</literal> can be set to the name of a type-specific
         subscripting handler function, or <literal>NONE</literal> to remove
         the type's subscripting handler function.  Using this option
         requires superuser privilege.
        </para>
       </listitem>
       <listitem>
        <para>
         <literal>STORAGE</literal><indexterm>
          <primary>TOAST</primary>
          <secondary>per-type storage settings</secondary>
         </indexterm>
         can be set to <literal>plain</literal>,
         <literal>extended</literal>, <literal>external</literal>,
         or <literal>main</literal> (see <xref linkend="storage-toast"/> for
         more information about what these mean).  However, changing
         from <literal>plain</literal> to another setting requires superuser
         privilege (because it requires that the type's C functions all be
         TOAST-ready), and changing to <literal>plain</literal> from another
         setting is not allowed at all (since the type may already have
         TOASTed values present in the database).  Note that changing this
         option doesn't by itself change any stored data, it just sets the
         default TOAST strategy to be used for table columns created in the
         future.  See <xref linkend="sql-altertable"/> to change the TOAST
         strategy for existing table columns.
        </para>
       </listitem>
      </itemizedlist>
      See <xref linkend="sql-createtype"/> for more details about these
      type properties.  Note that where appropriate, a change in these
      properties for a base type will be propagated automatically to domains
      based on that type.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
  </para>

  <para>
   The <literal>ADD ATTRIBUTE</literal>, <literal>DROP
   ATTRIBUTE</literal>, and <literal>ALTER ATTRIBUTE</literal> actions
   can be combined into a list of multiple alterations to apply in
   parallel.  For example, it is possible to add several attributes
   and/or alter the type of several attributes in a single command.
  </para>

  <para>
   You must own the type to use <command>ALTER TYPE</command>.
   To change the schema of a type, you must also have
   <literal>CREATE</literal> privilege on

Title: ALTER TYPE Subforms: Setting Properties for Base Types
Summary
The `ALTER TYPE` command allows modification of base-type properties like RECEIVE, SEND, TYPMOD_IN, TYPMOD_OUT, ANALYZE, and STORAGE. Setting these often requires superuser privileges. It also allows combining ADD/DROP/ALTER ATTRIBUTE actions for composite types. You must own the type to alter it.