Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 40FCB6502B1 for ; Mon, 3 Nov 2008 17:47:29 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 24737-01 for ; Mon, 3 Nov 2008 17:47:28 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mail.postgresql.org (Postfix) with ESMTP id BDF33650259 for ; Mon, 3 Nov 2008 17:47:28 -0400 (AST) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Kx7Gg-0004UR-I2 for pgsql-admin@postgresql.org; Mon, 03 Nov 2008 21:47:26 +0000 Received: from 77.70.61.39 ([77.70.61.39]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Nov 2008 21:47:26 +0000 Received: from milen by 77.70.61.39 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Nov 2008 21:47:26 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: "Milen A. Radev" Subject: Re: connect to psql without passwd Date: Mon, 03 Nov 2008 23:47:19 +0200 Lines: 29 Message-ID: References: <490F6EDE.70502@nrc-cnrc.gc.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 77.70.61.39 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) In-Reply-To: <490F6EDE.70502@nrc-cnrc.gc.ca> X-Archive-Number: 200811/15 X-Sequence-Number: 30669 Isabella Ghiurea написа: > I'm writing a shell script to run analyze and other jobs as use > postgres, having issues passing the passwd in psql is always asking for > password, I'm using .pgpass file as argument in psql ( I understood > PGPASS is depreciated). My .pgpass file contains only the passwd string > not the full connection string9 hostname, port etc) since this is local > connection , but is always asking for passwd, using :PG ver 8.3, RH 5, > The script contains something like : > Home= > PSQL= > PGDATA= > export HOME, PSQL, PGDATA etc > (cat $HOME/.pgpass > cat << EOF > REINDEX database test > ; > EOF > ) | $PSQL -U postgres -d test > /var/lib/pgsql//reindex.log You need to re-read the relevant page from the manual (http://www.postgresql.org/docs/current/static/libpq-pgpass.html). You don't need to supply the content of the file - psql (and all other programmes based on libpq) will look for it at a predefined place and use it if a few conditions are met (correct permissions on the file, correct syntax, etc). -- Milen A. Radev