Image description

First open terminal and

sudo apt update
sudo apt install postgresql postgresql-contrib

now you have downloaded necessary libraries. After that:

sudo -i -u postgres

This way you are switched to postgres user. and enter your password (of the previous user)

psql

With psql you are ready to perform postgres commands.

always use

\q

to leave postgres command line.

Finally, to create a database:

CREATE DATABASE exampledatabase;

Wish you an easy coding!

Logo

PostgreSQL社区为您提供最前沿的新闻资讯和知识内容

更多推荐