From abae617e900539f349d5b6aadf8c4f74fa17d153 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Wed, 19 Mar 2025 13:18:33 -0400 Subject: [PATCH] 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 64f8e133caeb..4e75a01fae4e 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=/etc/postgresql + + This will install the control SQL files into + /etc/postgresql/share and shared modules into + /etc/postgresql/lib. If the prefix does not + include the strings postgresql or + pgsql, such as: + +make install prefix=/etc/extras + + Then the postgresql directory will be appended io the + prefix, installing the control SQL files into + /etc/extras/postgresql/share and shared modules into + /etc/extras/postgresql/lib. Either way, you'll need to + set and to allow + PostgreSQL to find the files: + +extension_control_path = '/etc/extras/postgresql/share/extension:$system' +dynamic_library_path = '/etc/extras/postgresql/lib:$libdir' +