Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1isRR5-0002Xx-T9 for pgsql-general@arkaria.postgresql.org; Fri, 17 Jan 2020 13:13:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1isRR4-0007YA-AT for pgsql-general@arkaria.postgresql.org; Fri, 17 Jan 2020 13:13:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1isRR3-0007Y3-UC for pgsql-general@lists.postgresql.org; Fri, 17 Jan 2020 13:13:14 +0000 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1isRQw-00074x-3r for pgsql-general@lists.postgresql.org; Fri, 17 Jan 2020 13:13:12 +0000 Received: by mail-ot1-x342.google.com with SMTP id 66so22458779otd.9 for ; Fri, 17 Jan 2020 05:13:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=eu3R7XTxLPcTj1i69FNCrzTKcKptnc129j09TtaQYRw=; b=SQQCdOhvzbcBcC0WD2BsfcPoXGSas1jeAu8Gi/yAiPx48f0agxRivaPqfJ3AdFwX5I 3WfCI8W1fuSDbMKZDKAfPQm/qpIcUzMb4c4yBOarGzah4gQ8s6E10mxWo3O0emHM0i1O uiQn+T4zkTFxbf3ARW+g0yXJzrWVQlwaXzeUL6zG7gI8JW3Y5HAurlnn3IzG2eWF7hsB 1t64yipcmiZeGFsrQJsMNr6YwXOZaBETD7m3q65P3nCQ6phMc9vxl4/lk8U9MnvDHxlr HvUAwcBh/RpNGK5YvsdDkq8kKDiJ6AHifwdsbzJw8AT4kFK5T7IW/cYrjjprMVixwcJ9 Nt0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=eu3R7XTxLPcTj1i69FNCrzTKcKptnc129j09TtaQYRw=; b=M29OvCDqeaO4yiFAS2uw1Ie4hH6s0L2050sjf5lkTTyKByuKi2w7NETg48TdUSlcw4 Pvvu6xeMxjSKTlQu/pVrfFaMcKwCNz+rLkghpkVcUUrKH4PUi3TME6KZPz78jc8DSmzT zHRoTkujOizu1nKFDV5reZQDLGVGkHo9lJ89NQwSlcRPCC8rcc7SCYUAEfxzhxPkLh/h dJ+N+u5qtOYv1d9Rio9Tz+cSAjfZd7OfTsr/na8XRHiRRMt7nkw8Prp3VlpnMwPbckOp 11kIAHIWeiq7ksJBhcNvYp05RYGHK67BJ97+ITKz0CfjeC2fC4Yn/gpn7pUdcl4a0als bhxA== X-Gm-Message-State: APjAAAUyQFJs/9XafZk5hUkJi5gNh1lQtvpy9eksd65COivLpQtaIkHU Q11ieLgxXjjY8oFAG1R1DZGEMcuNETk= X-Google-Smtp-Source: APXvYqzoD/bq7v0Vyh8hAtXsvr0uqnbLT9XC+Ok2xHrSv3lzuF4xAgK/4l8UXi0QH8R+YF6m5ze/XQ== X-Received: by 2002:a9d:6e82:: with SMTP id a2mr5827280otr.336.1579266783730; Fri, 17 Jan 2020 05:13:03 -0800 (PST) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id c12sm7879286oic.27.2020.01.17.05.13.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jan 2020 05:13:03 -0800 (PST) Subject: Re: postgresql commands(psql,createdb,dropdb) are not working from shell script To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: Date: Fri, 17 Jan 2020 07:13:02 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------07F507E7FBEE2C6F08FB59DF" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------07F507E7FBEE2C6F08FB59DF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit The Jenkins server needs to be able to find the Unix executables dropdb, createdb and psql. I don't know *anything* about Jenkins, or even whether or not Jenkins runs on the same box as Postgres, but there's *some* shell script *somewhere* that points $PATH to the proper Postgres binaries. On 1/17/20 6:56 AM, Ramesh Penuballi wrote: > Dear Ron, > > Thanks for looking into this query. > > Could you please let me know how can I check the same. > > We are able take our production backup  from the  Jenkins server, and the > issue is with our uat database server only. > > Could you please let me know how to check the path on Jenkins server as I > am new to Jenkins. > > Thanks and Regards > Ramesh Penuballi > > On Fri, 17 Jan, 2020, 17:53 Ron, > wrote: > > Does the Jenkins' $PATH variable have the Postgres binaries' location? > > On 1/17/20 2:47 AM, ramesh penumalli wrote: >> Dear Team, >> >> I am using postgresql 9.2.12 version and I am facing  an issue while >> running the executing the commands createdb,dropdb,psql commands in >> the shell script which is running from Jenkins to restore prod data >> into stage environment. >> >> Jenkins job is failing with the below output.I have verified the >> script and the scrit is fine and it seems to be an issue with the >> configuration of postgresql  and not sure where to make the changes. >> >> line 48: dropdb: command not found >> line 50: createdb: command not found >> line 52: psql: command not found >> Kindly guide me to rectify the issue. >> Thanks and Regards, >> Ramesh > > -- > Angular momentum makes the world go 'round. > -- Angular momentum makes the world go 'round. --------------07F507E7FBEE2C6F08FB59DF Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit The Jenkins server needs to be able to find the Unix executables dropdb, createdb and psql.

I don't know anything about Jenkins, or even whether or not Jenkins runs on the same box as Postgres, but there's some shell script somewhere that points $PATH to the proper Postgres binaries.

On 1/17/20 6:56 AM, Ramesh Penuballi wrote:
Dear Ron, 

Thanks for looking into this query. 

Could you please let me know how can I check the same. 

We are able take our production backup  from the  Jenkins server, and the issue is with our uat database server only. 

Could you please let me know how to check the path on Jenkins server as I am new to Jenkins. 

Thanks and Regards 
Ramesh Penuballi 

On Fri, 17 Jan, 2020, 17:53 Ron, <ronljohnsonjr@gmail.com> wrote:
Does the Jenkins' $PATH variable have the Postgres binaries' location?

On 1/17/20 2:47 AM, ramesh penumalli wrote:
Dear Team,

I am using postgresql 9.2.12 version and I am facing  an issue while running the executing the commands createdb,dropdb,psql commands in the shell script which is running from Jenkins to restore prod data into stage environment.

Jenkins job is failing with the below output.I have verified the script and the scrit is fine and it seems to be an issue with the configuration of postgresql  and not sure where to make the changes.

line 48: dropdb: command not found
line 50: createdb: command not found
line 52: psql: command not found
Kindly guide me to rectify the issue.
Thanks and Regards,
Ramesh

--
Angular momentum makes the world go 'round.

--
Angular momentum makes the world go 'round.
--------------07F507E7FBEE2C6F08FB59DF--