Re: Problems with createdb.exe and createuser.exe

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Zhan Deng" <zdeng(at)copanion(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problems with createdb.exe and createuser.exe
Date: 2007-05-30 21:45:49
Message-ID: b42b73150705301445q47a98b46s80f6ee9a4f0855a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/29/07, Zhan Deng <zdeng(at)copanion(dot)com> wrote:
> After the installation, I was trying to run createdb.exe and createuser.exe
> utilities in a silent mode. But they always ask me to enter the password.
> Is there is a way that I can run them by passing the username/password from
> the command line without the prompting for entering password/interactive
> mode.

You have a few options here:
* set PGPASSWORD environment variable, either for user/system
* entry into .pgpass in home folder
* alter pg_hba.conf to not require password under certain conditions

Basically, this is standard authentication configuration (check the
documentation). How you do this has important security
considerations. The documentation should give you all the answers
here. What makes windows a bit peculiar is how you set environment
variables (set them permanently via the control panel) and the
location of the home folder (there is a trick to this which i forget).

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-05-30 22:11:33 Re: Full vacuum may reclaim space
Previous Message Alvaro Herrera 2007-05-30 21:33:55 Re: can i recover the database to a certain point...