postgresql rookie needs help initial setup help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

postgresql rookie needs help initial setup help

barry kimelman
Hello,

Although I have many years of database experience, I am new to postgresql.

My system is a 64 bit windows 10 laptop. I just downloaded and installed postgresql. The installation completed without any errors or complaints.

I was able to create a database with    "createdb -U postgres mydb"

Now I want to be able to create a non administrator user so I tried the following:
createuser --password -U postgres myusername

I was prompted for the password for "postgres" but I was not prompted for the password for the new user.

I tried to run a createdb command for the new user but password authentication failed.
Why was I not prompted for a password during the creation of the new user?
Reply | Threaded
Open this post in threaded view
|

Re: postgresql rookie needs help initial setup help

Tom Lane-2
barry kimelman <[hidden email]> writes:
> Now I want to be able to create a non administrator user so I tried the
> following:
> createuser --password -U postgres myusername
> I was prompted for the password for "postgres" but I was not prompted for
> the password for the new user.

I think the option you wanted was

  -P, --pwprompt            assign a password to new role

This is different from --password, which prompts you for your *own*
password in order to connect to the server.  Usually the only reason
to bother with that one is if you're writing some kind of script and
you would like it to prompt always, whether or not a password would
really be required.

                        regards, tom lane