Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YSMsZ-0000ZL-0m for pgsql-admin@arkaria.postgresql.org; Mon, 02 Mar 2015 09:43:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YSMsY-0005eK-B9 for pgsql-admin@arkaria.postgresql.org; Mon, 02 Mar 2015 09:43:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YSMsX-0005eC-6p for pgsql-admin@postgresql.org; Mon, 02 Mar 2015 09:43:09 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YSMsP-0002IH-K8 for pgsql-admin@postgresql.org; Mon, 02 Mar 2015 09:43:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20140207; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date; bh=Jwwu++U2+Ls9I1hnSQX16Q7KRqlAVi6lsq+J0SKNFLI=; b=mdl4xl2dFNtNEqkEBXkrqG9PFfdQ+DMNhm1MVALxXcIuTewIXkx5ozfBA77co+xJHx6HiWfmROjoyEreWB5ToddhNAPz99sCDogL/zbZdB2TqgTYvfl0v8MHe5oytHCj; Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by depesz.com with esmtpa (Exim 4.84) (envelope-from ) id 1YSMsM-0003m8-8Z; Mon, 02 Mar 2015 10:42:58 +0100 Date: Mon, 2 Mar 2015 10:42:58 +0100 From: hubert depesz lubaczewski To: Technical Doubts Cc: pgsql-admin@postgresql.org Subject: Re: Passing password in psql command Message-ID: <20150302094258.GB7715@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On Mon, Mar 02, 2015 at 02:57:46PM +0530, Technical Doubts wrote: > Dear Team, > We are unable to connect to PostgreSQL db using psql by passing password > parameter. If we don't give password, then on password promt it's accepting > the password we type. But our scheduler script is having the psql line with > password parameter. Helps highly appreciated. Thanks in advance. There is no option to provide password in command line. You either have to use environment variable, as described here: http://www.postgresql.org/docs/current/interactive/libpq-envars.html or pgpass file, as described here: http://www.postgresql.org/docs/current/interactive/libpq-pgpass.html Both of these places are listed in docs for psql (http://www.postgresql.org/docs/current/interactive/app-psql.html) in part "connecting to a database". depesz -- The best thing about modern society is how easy it is to avoid contact with it. http://depesz.com/ -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin