X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9ABA2D1B258 for ; Thu, 8 Jul 2004 13:44:22 -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 59101-07 for ; Thu, 8 Jul 2004 16:44:17 +0000 (GMT) Received: from emo.org.tr (emo.org.tr [195.142.105.9]) by svr1.postgresql.org (Postfix) with ESMTP id C89F9D1B1B3 for ; Thu, 8 Jul 2004 13:44:16 -0300 (ADT) Received: by emo.org.tr (Postfix, from userid 41643) id 680FA2FAB8; Thu, 8 Jul 2004 19:44:11 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by emo.org.tr (Postfix) with ESMTP id 5F82E111EDA; Thu, 8 Jul 2004 19:44:11 +0300 (EEST) Date: Thu, 8 Jul 2004 19:44:09 +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 a script using password In-Reply-To: <20040708160730.73409.qmail@web21326.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/106 X-Sequence-Number: 14174 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, On Thu, 8 Jul 2004, Hemapriya wrote: > Can anyone tell me how to connect to postgres from a > shell script using password. If i use psql -UUser db > -W option it prompts for password everytime.. > Is there anyway we can have the password included in > psql login command.? Try environmental variables. I use this one: ========================== export PGPASSWORD=password export PGUSER=username psql dbname ========================== Using ~/.pgpass might be another alternative. Regards, - -- Devrim GUNDUZ devrim~gunduz.org devrim.gunduz~linux.org.tr http://www.tdmsoft.com http://www.gunduz.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFA7Xnbtl86P3SPfQ4RAjNZAKDpOVd0wpOu0y3IDYPbq5tG9RFEgACeKDmC Pgbg6AI0xK3vWh2fW3SCZ8Q= =1Qfo -----END PGP SIGNATURE-----