Received: from dilbert.nurseamerica.net (unknown [207.53.237.114]) by postgresql.org (Postfix) with ESMTP id 58553477160 for ; Tue, 9 Jul 2002 11:22:38 -0400 (EDT) Received: from nurseamerica.net (archimedes.myrdin.net [206.176.158.41]) by dilbert.nurseamerica.net (8.11.6/8.11.6) with ESMTP id g69FMaj09992; Tue, 9 Jul 2002 10:22:36 -0500 Message-ID: <3D2AFFBB.6010801@nurseamerica.net> Date: Tue, 09 Jul 2002 10:22:35 -0500 From: Kevin Brannen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Michael A. Schulte" Cc: pgsql-admin@postgresql.org Subject: Re: psql in Batch mode and passwords? References: <3D2AA41B.7070608@sun.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200207/133 X-Sequence-Number: 4819 Michael A. Schulte wrote: > Hi, > > does anyone have an idea how to convince psql > to accept a password that is passed during startup > of psql in the command line? > > I don't want to modify pg_hba.conf so that it > is open for everyone so I have inserted: > > local all trust > host all 129.157.0.0 255.255.0.0 password > > > I look for something like: > psql -h somehost -a dash anonymous/anonym > where there exists a postgres user named "anonymous" > and the password is anonym. Try (assume a sh or ksh shell): PGPASSWORD=anonym psql -h somehost -U anonymous -a dash HTH, Kevin