I have just installed postgres 8.4 on Ubuntu 9.10 and it has never asked me to create a superuser. Is there a default superuser and its password? If not, how do I create a new one?
|
|
|
I'm not a postgres user (I use the other one) but to reset the (Ubuntu 9.10) password for postgres, how about
and give it a new password. |
|||||||||
|
|
CAUTION The answer about changing the UNIX password for "postgres" through "$ sudo passwd postgres" is not preferred, and can even be DANGEROUS! This is why: By default, the UNIX account "postgres" is locked, which means it cannot be logged in using a password. If you use "sudo passwd postgres", the account is immediately unlocked. Worse, if you set the password to something weak, like "postgres", then you are exposed to a great security danger. For example, there are a number of bots out there trying the username/password combo "postgres/postgres" to log into your UNIX system. What you should do is follow Chris James's answer:
To explain it a little bit. There are usually two default ways to login PostgreSQL:
So you never want to set the password for UNIX account "postgres". Leave it locked as it is by default. Of course things can change if you configure it differently from the default setting. For example, one could sync the PostgreSQL password with UNIX password and only allow local logins. That would be beyond the scope of this question. |
||||
|
on the command line $ sudo -u postgres psql postgres # \password postgres Enter new password: |
|||||
|
|
You manipulate postgres through the user
|
||||
|
|
For windows users, type
to change your password |
|||
|
|
|
Probably very relevant - "I'm installing PostgreSQL and don't know the password for the postgres user". |
|||
|
|