docker 部署PostgreSQL服务
拉一下容器
docker pull postgres
运行容器
docker run --name my-postgres -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres
以postgres用户身份进入容器
docker exec -it my-postgres psql -U postgres
创建数据库
CREATE DATABASE finance
本地python连接远程的数据库
```python
con1 = psycopg2.connect(dbname="finance", user="postgres", password="123456", host="远程主机地址ip", port="5432")
cur1 = con1.cursor()
postgresql_conn_pool1 = SimpleConnectionPool(5, 200,
host="远程主机地址ip",
port="5432",
user="postgres",
password="123456",
database="finance"
)