From d49d3445ca5bdde436713dc8a2ae7707683851e3 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Fri, 25 Apr 2025 15:22:23 -0400 Subject: [PATCH v3] Flesh out 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. --- doc/src/sgml/extend.sgml | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index 64f8e133cae..05063d4e7bc 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1809,10 +1809,35 @@ include $(PGXS) setting PG_CONFIG to point to its pg_config program, either within the makefile or on the make command line. - You can also select a separate installation directory for your extension - by setting the make variable prefix - on the make command line. (But this will then require - additional setup to get the server to find the extension there.) + + + + You can also select a separate directory prefix in which to install your + extension's files by setting the make variable + prefix when executing make install + like so: + +make install prefix=/usr/local/postgresql + + This will install the control SQL files into + /usr/local/postgresql/share and shared modules into + /usr/local/postgresql/lib. If the prefix does not + include the strings postgres or + pgsql, such as: + +make install prefix=/usr/local/extras + + Then the postgresql directory will be appended io the + prefix, installing the control and SQL files into + /usr/local/extras/postgresql/share/extension and shared + modules into /usr/local/extras/postgresql/lib. Either + way, you'll need to set and + to allow + PostgreSQL to find the files: + +extension_control_path = '/usr/local/extras/postgresql/share/extension:$system' +dynamic_library_path = '/usr/local/extras/postgresql/lib:$libdir' + -- 2.48.1