> For the complete documentation index, see [llms.txt](https://weerasak-chongnguluam.gitbook.io/sedoc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://weerasak-chongnguluam.gitbook.io/sedoc/postgresql/undefined.md).

# คำสั่งทั่วไป

### ติดตั้งผ่าน brew

```
> brew install postgresql
```

### สร้าง db ใหม่

```
createdb db_name
```

### ลด db

```
> dropdb db_name
```

### ใช้ psql เข้า db shell

```
> psql db_name
# หรือ ใช้ option เลือก user
> psql -U username db_name
# list db ทั้งหมด
> psql -l
# ระบุ hostname
> psql -h host_name
# จำไม่ได้แล้วดูที่เหลือเองด้วย
> man psql
```
