||A reader has identified this chapter as an undeveloped draft or outline.
You can help to develop the work, or you can ask for assistance in the project room.
Starting and stoppingEdit
$ /etc/init.d/postgresql start
Creating a userEdit
The following command creates a new user with superuser privileges:
$ createuser -U postgres -s <some username>
Creating a new user is a database operation, so it can only be done by an existing database user. You need to specify which database user to use (otherwise it will default to using a database user with the same name as your current UNIX user, which is unlikely to be correct). Default installs typically have a user called postgres that can be used for this.
To set a password for the newly created user, log in to the database using an account with superuser privileges, and issue the command:
ALTER USER <username> WITH ENCRYPTED PASSWORD 'secret';