Trivadis / pgbasenv

pgBasEnv - PostgreSQL Base Environment Tool

Home Page:https://github.com/Trivadis/pgbasenv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pgBasEnv sourcing

GMOSMAR opened this issue · comments

Hi
In the README.md is written : "File .pgbasenv_profile can be used to source pgBasEnv global environment. It will be added by default to the users ~/.pgsql_profile during installation. At next login pgBasEnv is sourced automatically."

In a fresh installation pgBasEnv is not sourced automatically.
The file ~/.pgsql_profile is created, but it isn't sourced anywhere.

You should change the text in the README.md, or ensure ~/.pgsql_profile is sourced on login.

Regards
Franco

Hi,

could you please provide some details?
which OS in place?
manually sourcing ~/.pgsql_profile works as expected?

how does your .bash_profile and .pgsql_profile look like?

Best,
Michael

Hi
I'm on SUSE Linux SLES 15.2
postgres user has /bin/bash as default shell
By default there is a .profile and a .bashrc, but no line in one of them which would source the .pgsql_profile

When I add the line
[[ -f ~/.pgbasenv_profile ]] && source ~/.pgbasenv_profile && pgup && pgsetenvsta --default
from the .pgsql_profile to the .profile everything works fine.

Franco

Hi,

ok I see.

Normally the Postgres installer should add something like this to the .profile.

[ -f /var/lib/pgsql/.pgsql_profile ] && source /var/lib/pgsql/.pgsql_profile

Since I install the pgbasenv as user postgres, I have no rights to create anything below /var/lib
Probably because /var/lib/pgsql/.pgsql_profile can't be created, nothing is added to .profile

sorry the misunderstanding

during the installation of the postgres-server software the installer should
automatically create the correct setting in you profile

above path is just an example from my local env, should point to your postgres user home directory normally