Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/alter_extension.sgml`
cde9b6f6c8f93e4f0412a8ca16630d816d7ec056634821550000000100000fae
 [, ...] ] ) ] |
  ROUTINE <replaceable class="parameter">routine_name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ] |
  SCHEMA <replaceable class="parameter">object_name</replaceable> |
  SEQUENCE <replaceable class="parameter">object_name</replaceable> |
  SERVER <replaceable class="parameter">object_name</replaceable> |
  TABLE <replaceable class="parameter">object_name</replaceable> |
  TEXT SEARCH CONFIGURATION <replaceable class="parameter">object_name</replaceable> |
  TEXT SEARCH DICTIONARY <replaceable class="parameter">object_name</replaceable> |
  TEXT SEARCH PARSER <replaceable class="parameter">object_name</replaceable> |
  TEXT SEARCH TEMPLATE <replaceable class="parameter">object_name</replaceable> |
  TRANSFORM FOR <replaceable>type_name</replaceable> LANGUAGE <replaceable>lang_name</replaceable> |
  TYPE <replaceable class="parameter">object_name</replaceable> |
  VIEW <replaceable class="parameter">object_name</replaceable>

<phrase>and <replaceable>aggregate_signature</replaceable> is:</phrase>

* |
[ <replaceable>argmode</replaceable> ] [ <replaceable>argname</replaceable> ] <replaceable>argtype</replaceable> [ , ... ] |
[ [ <replaceable>argmode</replaceable> ] [ <replaceable>argname</replaceable> ] <replaceable>argtype</replaceable> [ , ... ] ] ORDER BY [ <replaceable>argmode</replaceable> ] [ <replaceable>argname</replaceable> ] <replaceable>argtype</replaceable> [ , ... ]
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>ALTER EXTENSION</command> changes the definition of an installed
   extension.  There are several subforms:

   <variablelist>
   <varlistentry>
    <term><literal>UPDATE</literal></term>
    <listitem>
     <para>
      This form updates the extension to a newer version.  The extension
      must supply a suitable update script (or series of scripts) that can
      modify the currently-installed version into the requested version.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>SET SCHEMA</literal></term>
    <listitem>
     <para>
      This form moves the extension's objects into another schema. The
      extension has to be <firstterm>relocatable</firstterm> for this command to
      succeed.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>ADD <replaceable class="parameter">member_object</replaceable></literal></term>
    <listitem>
     <para>
      This form adds an existing object to the extension.  This is mainly
      useful in extension update scripts.  The object will subsequently
      be treated as a member of the extension; notably, it can only be
      dropped by dropping the extension.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>DROP <replaceable class="parameter">member_object</replaceable></literal></term>
    <listitem>
     <para>
      This form removes a member object from the extension.  This is mainly
      useful in extension update scripts.  The object is not dropped, only
      disassociated from the extension.
     </para>
    </listitem>
   </varlistentry>
   </variablelist>

   See <xref linkend="extend-extensions"/> for more information about these
   operations.
  </para>

  <para>
   You must own the extension to use <command>ALTER EXTENSION</command>.
   The <literal>ADD</literal>/<literal>DROP</literal> forms require ownership of the
   added/dropped object as well.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <para>
   <variablelist>
    <varlistentry>
     <term><replaceable class="parameter">name</replaceable></term>
     <listitem>
      <para>
       The name of an installed extension.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable class="parameter">new_version</replaceable></term>

Title: ALTER EXTENSION Description and Parameters
Summary
The `ALTER EXTENSION` command is used to modify an installed extension in PostgreSQL. It allows updating the extension to a newer version using update scripts, moving the extension's objects to a different schema (if the extension is relocatable), and adding or dropping existing objects as members of the extension, mainly used in update scripts. The user must own the extension and the objects being added or dropped. The section also details the parameters such as the extension name and new version.