Обсуждение: interactif pg environnement script
Hi all, I have 2 postgres environment 9.3 and 9.4 on the same machine. I try to write a little interactif script to choose 9.3 or 9.4. when connecting as postgres user. That is to say: if choosing 9.3 it launchs '9-3pg_eng.sh' and if choosing 9.4 it launch '9-4pg_env.sh'. I already have both 2 scripts ' 9-3pg_eng.sh' and '9-4pg_env.sh' which run fine. thanks lot koff
Hello Koff10
Onece I have been in this situation and what I did was create 2 users postgres: postgres93 and postgres94. Ich user whit diferent enviroment variables in the ".bashrc" and it's work great.
On Nov 6, 2015 5:57 PM, "koff10" <koff10@hotmail.com> wrote:
Hi all,
I have 2 postgres environment 9.3 and 9.4 on the same machine.
I try to write a little interactif script to choose 9.3 or 9.4. when connecting as postgres user.
That is to say: if choosing 9.3 it launchs '9-3pg_eng.sh' and if choosing 9.4 it launch '9-4pg_env.sh'.
I already have both 2 scripts ' 9-3pg_eng.sh' and '9-4pg_env.sh' which run fine.
thanks lot
koff
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Hello ,
thanks for your reply.
In fact what I need is an interactif script for 1 postgres user ( not 2 users postgres) which has 2 differents environment to choose.
thanks
koff
thanks for your reply.
In fact what I need is an interactif script for 1 postgres user ( not 2 users postgres) which has 2 differents environment to choose.
thanks
koff
Le 08/11/2015 23:09, Dorian Machado a écrit :
Hello Koff10
Onece I have been in this situation and what I did was create 2 users postgres: postgres93 and postgres94. Ich user whit diferent enviroment variables in the ".bashrc" and it's work great.
On Nov 6, 2015 5:57 PM, "koff10" <koff10@hotmail.com> wrote:Hi all,
I have 2 postgres environment 9.3 and 9.4 on the same machine.
I try to write a little interactif script to choose 9.3 or 9.4. when connecting as postgres user.
That is to say: if choosing 9.3 it launchs '9-3pg_eng.sh' and if choosing 9.4 it launch '9-4pg_env.sh'.
I already have both 2 scripts ' 9-3pg_eng.sh' and '9-4pg_env.sh' which run fine.
thanks lot
koff
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Hello koff10
--
I wrote this shell script for your case, I hope this help
#!/bin/bash
echo "Choose PostgreSQL Vervesion"
echo -n "type 93 for 9.3 or 94 for 9.4 > "
read version
if [ $version -eq 93 ]; then
sh 9-3pg_eng.sh
echo "You chose Version 9.3"
elif [ $version -eq 94 ]; then
sh 9-4pg_env.sh
echo "You chose Version 9.4"
else
echo "Wrong Version"
fi
On Thu, Nov 12, 2015 at 6:22 AM, koff10 <koff10@hotmail.com> wrote:
Hello ,
thanks for your reply.
In fact what I need is an interactif script for 1 postgres user ( not 2 users postgres) which has 2 differents environment to choose.
thanks
koffLe 08/11/2015 23:09, Dorian Machado a écrit :Hello Koff10
Onece I have been in this situation and what I did was create 2 users postgres: postgres93 and postgres94. Ich user whit diferent enviroment variables in the ".bashrc" and it's work great.
On Nov 6, 2015 5:57 PM, "koff10" <koff10@hotmail.com> wrote:Hi all,
I have 2 postgres environment 9.3 and 9.4 on the same machine.
I try to write a little interactif script to choose 9.3 or 9.4. when connecting as postgres user.
That is to say: if choosing 9.3 it launchs '9-3pg_eng.sh' and if choosing 9.4 it launch '9-4pg_env.sh'.
I already have both 2 scripts ' 9-3pg_eng.sh' and '9-4pg_env.sh' which run fine.
thanks lot
koff
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Dorian Machado