df7cb / pg_filedump

pg_filedump provides facilities for low-level examination of PostgreSQL tables and indexes
43 stars 18 forks source link

Compilation, installation and tests without postgres bin directory in PATH #21

Closed Green-Chan closed 4 months ago

Green-Chan commented 11 months ago

The following instruction in README makes no sense:

Compile/Installation:

To compile pg_filedump, you will need to have a properly configured PostgreSQL source tree or the devel packages (with include files) of the appropriate PostgreSQL major version.

make PG_CONFIG=/path/to/postgresql/bin/pg_config
make install PG_CONFIG=/path/to/postgresql/bin/pg_config

PG_CONFIG is always set to "pg_config" in Makefile, and the value "/path/to/postgresql/bin/pg_config" is ignored: PG_CONFIG = pg_config

I suggest (the first commit) changing this line to: PG_CONFIG ?= pg_config

This allows building and installing pg_filedump without postgres bin directory in PATH. But bin directory in PATH is still needed to run make installcheck. The second commit allows running tests without it:

make installcheck PG_CONFIG=/path/to/postgresql/bin/pg_config
df7cb commented 4 months ago

Hi,

PG_CONFIG = pg_config is overridable by make PG_CONFIG=/elsewhere, but your suggestion is still an improvement since it makes the slightly different PG_CONFIG=/elsewhere make also work, so I picked that commit.

The second change is unfortunately not good - Debian installs pg_filedump into /usr/bin since it's cross-version compatible. Looking for it in /usr/lib/postgresql/NN/bin will fail. I'll adjust the Makefile to set PATH instead.

Thanks!

Green-Chan commented 4 months ago

I'll adjust the Makefile to set PATH instead.

Thank you! It works perfectly.