Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If everything goes fine, you can check your created database by \l command as below:

Code Block

\l


The result will be like:

Code Block
 mydb       | postgres | UTF8      | en_US.UTF-8 | C     | =Tc/postgres           +
            |          |           |             |       | postgres=CTc/postgres  +
            |          |           |             |       | myuser=CTc/postgres
 postgres   | postgres | SQL_ASCII | en_US.UTF-8 | C     |
 template0  | postgres | SQL_ASCII | en_US.UTF-8 | C     | =c/postgres            +
            |          |           |             |       | postgres=CTc/postgres
 template1  | postgres | UTF8      | en_US.UTF-8 | C     |


You can also do above directly make psql commands one by one by adding -c parameter:

Code Block
sudo -u postgres psql -c "CREATE USER your_user_id with password 'your_password' superuser;"

...