1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Clean up installation directory choices for extensions.

Arrange for the control files to be in $SHAREDIR/extension not
$SHAREDIR/contrib, since we're generally trying to deprecate the term
"contrib" and this is a once-in-many-moons opportunity to get rid of it in
install paths.  Fix PGXS to install the $EXTENSION file into that directory
no matter what MODULEDIR is set to; a nondefault MODULEDIR should only
affect the script and secondary extension files.  Fix the control file
directory parameter to be interpreted relative to $SHAREDIR, to avoid a
surprising disconnect between how you specify that and what you set
MODULEDIR to.

Per discussion with David Wheeler.
This commit is contained in:
Tom Lane
2011-02-11 22:53:43 -05:00
parent 1214749901
commit 24d1280c4d
4 changed files with 49 additions and 30 deletions

View File

@ -365,13 +365,13 @@
The <xref linkend="sql-createextension"> command relies on a control
file for each extension, which must be named the same as the extension
with a suffix of <literal>.control</>, and must be placed in the
installation's <literal>SHAREDIR/contrib</literal> directory. There
installation's <literal>SHAREDIR/extension</literal> directory. There
must also be at least one <acronym>SQL</> script file, which follows the
naming pattern
<literal><replaceable>extension</>-<replaceable>version</>.sql</literal>
(for example, <literal>foo-1.0.sql</> for version <literal>1.0</> of
extension <literal>foo</>). By default, the script file(s) are also
placed in the <literal>SHAREDIR/contrib</literal> directory; but the
placed in the <literal>SHAREDIR/extension</literal> directory; but the
control file can specify a different directory for the script file(s).
</para>
@ -395,7 +395,9 @@
<para>
The directory containing the extension's <acronym>SQL</> script
file(s). Unless an absolute path is given, the name is relative to
the <literal>SHAREDIR/contrib</literal> directory.
the installation's <literal>SHAREDIR</literal> directory. The
default behavior is equivalent to specifying
<literal>directory = 'extension'</>.
</para>
</listitem>
</varlistentry>
@ -904,16 +906,6 @@ include $(PGXS)
The following variables can also be set:
<variablelist>
<varlistentry>
<term><varname>MODULEDIR</varname></term>
<listitem>
<para>
subdirectory into which EXTENSION, DATA and DOCS files should be
installed (if not set, default is <literal>contrib</literal>)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>EXTENSION</varname></term>
<listitem>
@ -921,7 +913,20 @@ include $(PGXS)
extension name(s); for each name you must provide an
<literal><replaceable>extension</replaceable>.control</literal> file,
which will be installed into
<literal><replaceable>prefix</replaceable>/share/$MODULEDIR</literal>
<literal><replaceable>prefix</replaceable>/share/extension</literal>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>MODULEDIR</varname></term>
<listitem>
<para>
subdirectory of <literal><replaceable>prefix</>/share</literal>
into which DATA and DOCS files should be installed
(if not set, default is <literal>extension</literal> if
<varname>EXTENSION</varname> is set,
or <literal>contrib</literal> if not)
</para>
</listitem>
</varlistentry>

View File

@ -67,7 +67,7 @@ CREATE EXTENSION <replaceable class="parameter">extension_name</replaceable>
The name of the extension to be
installed. <productname>PostgreSQL</productname> will create the
extension using details from the file
<literal>SHAREDIR/contrib/</literal><replaceable class="parameter">extension</replaceable><literal>.control</literal>.
<literal>SHAREDIR/extension/</literal><replaceable class="parameter">extension_name</replaceable><literal>.control</literal>.
</para>
</listitem>
</varlistentry>