Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by postgresql.org (Postfix) with ESMTP id 513794758EC for ; Wed, 27 Mar 2002 20:49:35 -0500 (EST) Received: from oasis.net.au (guardian [210.8.139.5]) by water.oasis.net.au (8.9.3/100.1) with ESMTP id LAA12778 for ; Thu, 28 Mar 2002 11:53:02 +1000 X-Authentication-Warning: water.oasis.net.au: Host guardian [210.8.139.5] claimed to be oasis.net.au Message-ID: <3CA27648.7060307@oasis.net.au> Date: Thu, 28 Mar 2002 11:47:52 +1000 From: Rudi Starcevic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: psql and password Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/367 X-Sequence-Number: 7241 Hi, I'm wondering how I can create a database for a user from within a script. I have Pg in 'password' mode. To create this database I'm trying to pass in the password from the script. For example : echo myPgPassword | /usr/local/pgslq/bin/createdb yourNewPgDatabase But it's not working. I'm still prompted for the password. My goal is to create the database then change ownership of the database. The user can then log straight in using phpPgAdmin. Can you see where I'm going wrong ? Any suggestions ? Perhaps I need to use 'Expect' or something ( this is a Debian box ) Thanks Kind Regards Rudi.