Home Explore Blog Models CI



postgresql

3rd chunk of `doc/src/sgml/ref/create_extension.sgml`
e946996f4a93aade72e93443f4b54802fecc371b0a5fc580000000010000081d
 </listitem>
     </varlistentry>

     <varlistentry>
      <term><replaceable class="parameter">version</replaceable></term>
      <listitem>
       <para>
        The version of the extension to install.  This can be written as
        either an identifier or a string literal.  The default version is
        whatever is specified in the extension's control file.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><literal>CASCADE</literal></term>
      <listitem>
       <para>
        Automatically install any extensions that this extension depends on
        that are not already installed.  Their dependencies are likewise
        automatically installed, recursively.  The <literal>SCHEMA</literal> clause,
        if given, applies to all extensions that get installed this way.
        Other options of the statement are not applied to
        automatically-installed extensions; in particular, their default
        versions are always selected.
       </para>
      </listitem>
     </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   Before you can use <command>CREATE EXTENSION</command> to load an extension
   into a database, the extension's supporting files must be installed.
   Information about installing the extensions supplied with
   <productname>PostgreSQL</productname> can be found in
   <link linkend="contrib">Additional Supplied Modules</link>.
  </para>

  <para>
   The extensions currently available for loading can be identified from the
   <link linkend="view-pg-available-extensions"><structname>pg_available_extensions</structname></link>
   or
   <link linkend="view-pg-available-extension-versions"><structname>pg_available_extension_versions</structname></link>
   system views.
  </para>

  <caution>
   <para>
    Installing an extension as superuser requires trusting that the
    extension's author wrote the extension installation script in a secure
    fashion.  It is not terribly difficult for a malicious user to create
    trojan-horse objects

Title: CREATE EXTENSION: Version, Cascade, and Notes
Summary
This section describes the 'version' and 'CASCADE' parameters of the CREATE EXTENSION command. 'version' specifies the extension version to install, defaulting to the control file's setting. 'CASCADE' automatically installs required, uninstalled dependencies, applying the SCHEMA clause to them. The section also includes notes on installing extension support files and identifying available extensions, along with a caution about the security risks of installing extensions as superuser.