Thread: Create database without entering password at command line

Create database without entering password at command line

From
"Nathan Thatcher"
Date:
I am trying to automatically create a database right after installing
postgres. I launch the silent install (Windows) from my own executable
and once it is done I need to create a database, tables, etc. I am
trying to find a way to do this without having to explicitly enter the
password in at the command prompt. What is the best way to do this?

Thanks,
Nate

Re: Create database without entering password at command line

From
Chris
Date:
Nathan Thatcher wrote:
> I am trying to automatically create a database right after installing
> postgres. I launch the silent install (Windows) from my own executable
> and once it is done I need to create a database, tables, etc. I am
> trying to find a way to do this without having to explicitly enter the
> password in at the command prompt. What is the best way to do this?

You could use a pgpass file:

http://www.postgresql.org/docs/current/static/libpq-pgpass.html

--
Postgresql & php tutorials
http://www.designmagick.com/