Trivadis / pgbasenv

pgBasEnv - PostgreSQL Base Environment Tool
https://github.com/Trivadis/pgbasenv
Apache License 2.0
9 stars 3 forks source link

pgBasEnv sourcing #9

Closed GMOSMAR closed 1 year ago

GMOSMAR commented 2 years ago

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

mmuehlbeyer commented 2 years ago

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

GMOSMAR commented 2 years ago

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

mmuehlbeyer commented 2 years ago

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

GMOSMAR commented 2 years ago

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

mmuehlbeyer commented 2 years ago

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