psql and password

From: Rudi Starcevic <rudi(at)oasis(dot)net(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: psql and password
Date: 2002-03-28 01:47:52
Message-ID: 3CA27648.7060307@oasis.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rudi Starcevic 2002-03-28 05:06:41 Re: psql and password
Previous Message Stephan Szabo 2002-03-27 20:37:07 Re: function error