parsed.org

Tips by tag: createdb

Adding a Database and a User by xinu on Dec 18, 2005 01:43 PM

To create a Postgres user sam and a database samdb that is owned by the sam user:

$ su - postgres
$ createuser -P -A -D sam
$ createdb -O sam samdb

(Change the -A, and -D options to affect the new user's abilities.)

Edit the user's password with:

template1=# alter user username_here with password 'password_here';
accountcommandscreatedbcreateuserpermissionspostgresqluser
RSS