Re: Password as a command line argument to createuser

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Jane Ren <j2ren(at)ucsd(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Password as a command line argument to createuser
Date: 2007-12-19 06:21:09
Message-ID: 4768B855.20601@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jane Ren wrote:
> Hi,
>
> I need to write a script that creates a new user with a password
> automatically.
>
> Is there a way I can specify the password as a command line argument to
> createuser?
>

Since you have access to the shell use psql -U user -c "create role ..."

Joshua D. Drake

> It looks like postgres does not read from stdin, but from /dev/tty.
>
> Thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-12-19 06:23:20 Re: Password as a command line argument to createuser
Previous Message Jane Ren 2007-12-19 06:04:13 Password as a command line argument to createuser