psql and password - Mailing list pgsql-sql

From Rudi Starcevic
Subject psql and password
Date
Msg-id 3CA27648.7060307@oasis.net.au
Whole thread Raw
Responses Re: psql and password  (Oliver Elphick <olly@lfix.co.uk>)
List 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.





pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: function error
Next
From: Rudi Starcevic
Date:
Subject: Re: psql and password