Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PSQL,Createdb,Dropdb commands are not working from shell script

5 views
Skip to first unread message

Ramesh Penuballi

unread,
Jan 17, 2020, 4:22:17 AM1/17/20
to
Dear Team,

I am using postgresql9.2.12 on RHEL 7 and running jenkins job to restore the production data into our uat environment.
But the job is failing with the below errors.

./script.sh: line 48: dropdb: command not found
+++ echo 'createdb --host xxx.com --username crowduser crowddb'
createdb --host xxx.com --username crowduser crowddb
+++ createdb --host xxx.com --username crowduser crowddb
./script.sh: line 50: createdb: command not found
+++ echo ' psql --host xxx.com --username crowduser -c "ALTER DATABASE crowddb OWNER TO crowduser;"'
psql --hostxxx.com --username crowduser -c "ALTER DATABASE crowddb OWNER TO crowduser;"
+++ psql --host xxx.com--username crowduser -c 'ALTER DATABASE crowddb OWNER TO crowduser;'
./script.sh: line 52: psql: command not found

But the commands are working fine from command prompt and it seems to be that there is some configuration issue on my postgres server.

Could you please help me to resolve the issue.


Thanks and Regards,
Ramesh
0 new messages