---
# System prepended metadata

title: PostgreSQL (Windows)

---

# PostgreSQL (Windows)

[安裝注意事項](https://medium.com/pgsql-tw/postgresql-%E5%BE%9E%E5%AE%89%E8%A3%9D%E9%96%8B%E5%A7%8B-windows-4def042ab97b)
- Data Directory 記得選擇空間大的地方!
- 千萬別忘記設定的 Password

[允許他人連線](https://www.netiq.com/zh-tw/documentation/identity-manager-47/setup_windows/data/t45mzvjb68l4.html)
修改 postgres\data\ 資料夾下的兩個設定檔
1. 在 postgresql.conf 檔案中變更監聽位址。(postgresql.conf)
    > listen_addresses = '*'
2. 將用戶端驗證項目新增至 pg_hba.conf 檔案中。
    > host all all 0.0.0.0/0 md5
3. 重新啟動遠端 PostgreSQL 伺服器

[pgAdmin 連線方式](http://ailog.tw/lifelog/2020/01/11/postgresql-free-gui/)
[pgAdmin 操作簡介](https://medium.com/@marcushsieh/postgresql-10-%E5%88%9D%E5%AD%B8%E8%B8%A9%E5%9D%91%E6%8E%92%E9%99%A4%E6%97%A5%E8%AA%8C-37fc13a5134)
[查找table及column name](https://kb.objectrocket.com/postgresql/connect-to-postgresql-and-show-the-table-schema-967)
```
$ SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema';
$ SELECT column_name, data_type FROM information_schema.columns WHERE TABLE_NAME = 'table_name';
```
[PostgreSQL連接Python](http://tw.gitbook.net/postgresql/2013080998.html)