X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 64824D7145 for ; Mon, 22 Aug 2005 14:35:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01861-02 for ; Mon, 22 Aug 2005 17:35:02 +0000 (GMT) Received: from emo.org.tr (emo.org.tr [195.142.106.94]) by svr1.postgresql.org (Postfix) with ESMTP id 3FE3BD6DFB for ; Mon, 22 Aug 2005 14:35:01 -0300 (ADT) Received: by emo.org.tr (Postfix, from userid 41643) id 329302FAF3; Mon, 22 Aug 2005 20:34:57 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by emo.org.tr (Postfix) with ESMTP id 1DD6D1122A9; Mon, 22 Aug 2005 20:34:57 +0300 (EEST) Date: Mon, 22 Aug 2005 20:34:54 +0300 (EEST) From: Devrim GUNDUZ X-X-Sender: devrim2@emo.org.tr To: Hemapriya Cc: pgsql-admin@postgresql.org Subject: Re: connect to postgres from shell scripts In-Reply-To: <20050822154246.28488.qmail@web34210.mail.mud.yahoo.com> Message-ID: References: <20050822154246.28488.qmail@web34210.mail.mud.yahoo.com> MIME-Version: 1.0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.153 required=5 tests=[AWL=-0.054, UPPERCASE_25_50=0.207] X-Spam-Level: Content-Type: TEXT/PLAIN; CHARSET=iso-8859-9; FORMAT=flowed Content-Transfer-Encoding: 8BIT Content-ID: X-Archive-Number: 200508/270 X-Sequence-Number: 18589 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-932793750-1124732087=:30926 Content-Type: TEXT/PLAIN; CHARSET=iso-8859-9; FORMAT=flowed Content-Transfer-Encoding: 8BIT Content-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, On Mon, 22 Aug 2005, Hemapriya wrote: > I would like to know how to connect to postgres from > shell scripts using a password protected user. > > Is there a way to embed the password in psql login. > It keeps prompting for the passwords. psql checks for PGUSER, PGPASSWORD, PGHOST, PGPORT, PGDATABASE and some other environmental variables. Export relevant values to the parameters. http://www.postgresql.org/docs/8.0/static/libpq-envars.html Also there's a .pgpass file thing: http://www.postgresql.org/docs/8.0/static/libpq-pgpass.html Regards, - -- Devrim GUNDUZ Kivi Biližim Teknolojileri - http://www.kivi.com.tr devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDCgzAtl86P3SPfQ4RAo5PAJ9y9Pm7ii8z50ZrSB7Bws1qhQU++gCfUepu C3ErI3WBVLPIJ8ShVPE29Dk= =dCI+ -----END PGP SIGNATURE----- --8323328-932793750-1124732087=:30926--