Database Reference
In-Depth Information
F Execution timing by using the \timing command
F Input/Output and editing commands
F Automatic startup files: .psqlrc
F Substitutable parameters ("variables")
F Access to the OS command line
Changing your password securely
If you are using password authentication, then you may wish to change your password
from time to time.
How to do it...
The most basic method is to use psql. The \password command will prompt you for
a new password, and then again to confirm. Connect to psql, and type the following:
\password
Enter new password.
This causes psql to send an SQL statement to the PostgreSQL server containing an already
encrypted password string. An example of the SQL statement sent is as follows:
ALTER USER postgres PASSWORD ' md53175bce1d3201d16594cebf9d7eb3f9d';
Whatever you do, don't use "postgres" as your password. This will make you vulnerable to idle
hackers, so make it a little more difficult than that, please.
Make sure you don't forget it either. It could prove difficult to maintain your database if you
can't get access to it later.
How it works...
As changing the password is just an SQL statement, any interface can do this. Other tools
also allow this, such as:
F pgAdmin3
F phpPgAdmin
If you don't use one of the main password changes routes, you can still do this yourself using
SQL from any interface. Note that you need to encrypt your password, because if you do
submit a password in plaintext, like the following:
ALTER USER myuser PASSWORD 'secret'
 
Search WWH ::




Custom Search