pgenv version 1.3.3 releasedpgenv release 1.3.3 is now available. This release introduces two main environment variables to instrument the application about configuration files. The first variable is
PGENV_CONFIGURATION_FILE: such variable can be set to force
pgenvto use a custom configuration file without having to guess which file to use depending on the specific PostgreSQL version in use. By default,
pgenvlooks for a configuration file named after the PostgreSQL version, or if not found, a
default.confconfiguration file. Using the above variable, it is now possible to pass information to
pgenvabout where a configuration is, and this allows for the same configuration file to be used over and over without any regard to the PostgreSQL version.
% export PGENV_CONFIGURATION_FILE=~/git/dot-files/pgenv/luca.conf % pgenv rebuild 16.0 Using PGENV_ROOT /home/luca/git/pgenv [DEBUG] Configuration file forced by environment variable PGENV_CONFIGURATION_FILE = /home/luca/git/dot-files/pgenv/luca.conf [DEBUG] Configuration file forced by environment variable PGENV_CONFIGURATION_FILE = /home/luca/git/dot-files/pgenv/luca.conf [DEBUG] Looking for configuration in /home/luca/git/dot-files/pgenv/luca.conf ...
As you can see,
pgenvwill now use the specified configuration file. The other variable added is
PGENV_WRITE_CONFIGURATION_FILE_AUTOMATICALLY, that if set to a false value (e.g.,
no) will prevent
pgenvto write or overwrite a configuration file once a
rebuildis completed. The normal behavior is to let
pgenvto write/overwrite the configuration file if this variable is not set at all or is set to a true value (e.g.,
yes), and this is the behavior of previos releases. Since today, if you set this variable to a false value,
pgenvwill not create (nor overwrite) a configuration file at the end of a build phase.
% export PGENV_WRITE_CONFIGURATION_FILE_AUTOMATICALLY=no % pgenv rebuild 16.0 ... [DEBUG] Not writing config file automatically: set `PGENV_WRITE_CONFIGURATION_FILE_AUTOMATICALLY` to a true value to enable the automatic file writing PostgreSQL 16.0 built
As you see from the above,
pgenvwill complain it cannot write the configuration file for this build. Thanks to this option, you will be sure your carefully crafted configuration file will never be overwritten accidentally (please note that
pgenvalways make a backup copy before overwriting an existing file). Last, the new subcommand
config pathhas been added: the idea is to show to the user where
pgenvexpects to find a configuration file and what is going to use without any custom changes.
% pgenv config path Using PGENV_ROOT /home/luca/git/pgenv /home/luca/git/pgenv/config/default.conf