yum install -y postgresql-server
postgresql-setup initdb
systemctl restart postgresql
systemctl enable postgresql
su - postgres
psql
\list
![](https://www.wuweixin.com/wp-content/uploads/2021/01/image-2-1024x265.png)
CREATE DATABASE demodb;
\connect demodb
CREATE TABLE demotable(title char(32));
INSERT INTO demotable (title) VALUES('title');
SELECT * FROM demotable;
![](https://www.wuweixin.com/wp-content/uploads/2021/01/image-3.png)
\quit