Skip to content

Commit 0064020

Browse files
committed
doc: Flesh out extension docs for the "prefix" make variable
The variable is a bit magical in how it requires "postgresql" or "pgsql" to be part of the path, and files end up in its "share" and "lib" subdirectories. So mention all that and show an example of setting "extension_control_path" and "dynamic_library_path" to use those locations. Author: David E. Wheeler <david@justatheory.com> Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com> Reviewed-by: Christoph Berg <myon@debian.org> Discussion: https://www.postgresql.org/message-id/6B5BF07B-8A21-48E3-858C-1DC22F3A28B4@justatheory.com
1 parent 4ea1254 commit 0064020

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

doc/src/sgml/extend.sgml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,10 +1809,36 @@ include $(PGXS)
18091809
setting <varname>PG_CONFIG</varname> to point to its
18101810
<command>pg_config</command> program, either within the makefile
18111811
or on the <literal>make</literal> command line.
1812-
You can also select a separate installation directory for your extension
1813-
by setting the <literal>make</literal> variable <varname>prefix</varname>
1814-
on the <literal>make</literal> command line. (But this will then require
1815-
additional setup to get the server to find the extension there.)
1812+
</para>
1813+
1814+
<para>
1815+
You can select a separate directory prefix in which to install your
1816+
extension's files, by setting the <command>make</command> variable
1817+
<varname>prefix</varname> when executing <literal>make install</literal>
1818+
like so:
1819+
<programlisting>
1820+
make install prefix=/usr/local/postgresql
1821+
</programlisting>
1822+
This will install the extension control and SQL files into
1823+
<filename>/usr/local/postgresql/share</filename> and the shared modules into
1824+
<filename>/usr/local/postgresql/lib</filename>. If the prefix does not
1825+
include the strings <literal>postgres</literal> or
1826+
<literal>pgsql</literal>, such as
1827+
<programlisting>
1828+
make install prefix=/usr/local/extras
1829+
</programlisting>
1830+
then <literal>postgresql</literal> will be appended to the directory
1831+
names, installing the control and SQL files into
1832+
<filename>/usr/local/extras/share/postgresql/extension</filename> and the
1833+
shared modules into <filename>/usr/local/extras/lib/postgresql</filename>.
1834+
Either way, you'll need to set <xref
1835+
linkend="guc-extension-control-path"/> and <xref
1836+
linkend="guc-dynamic-library-path"/> to enable the
1837+
<productname>PostgreSQL</productname> server to find the files:
1838+
<programlisting>
1839+
extension_control_path = '/usr/local/extras/share/postgresql/extension:$system'
1840+
dynamic_library_path = '/usr/local/extras/lib/postgresql:$libdir'
1841+
</programlisting>
18161842
</para>
18171843

18181844
<para>

0 commit comments

Comments
 (0)