Monthly Archive: April, 2019

psql connect docker postgresql

方式一、

docker exec -u 0 -it <CONTAINER ID> bash
su postgres
psql -U <DBUSER> -W -d <DBNAME>

# 查看PGSQL默认服务
pstree

方式二、

docker run -it --rm --network docker_odoonetwork postgres psql -h pgsql -U odoo -d analogcircuit

docker-compose.yml

version: '2'
services:
  web:
    image: odoo:12.0
    container_name: odoo
    depends_on:
      - db
    ports:
      - "8069:8069"
    networks:
      - "odoonetwork"
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./config:/etc/odoo
      - ./addons:/mnt/extra-addons
  db:
    image: postgres:10
    container_name: pgsql
    networks:
      - "odoonetwork"
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - odoo-db-data:/var/lib/postgresql/data/pgdata
networks:
  odoonetwork:
    driver: bridge  
volumes:
  odoo-web-data:
  odoo-db-data:

Process finished with exit code -1073740940 (0xC0000374)

问题重现

最近将系统升级到了Windows LTSC 2019,且使用了较新的Python(3.7.3),在调试Odoo12的时候,Pycharm直接抛出错误"Process finished with exit code -1073740940 (0xC0000374)",经过各方查证,发现问题是由于locale这个包引起的。

Locale

解决方法

控制面板—>区域

区域
设置

到此,重启计算机,问题修复。

参考来源:https://youtrack.jetbrains.com/issue/PY-33045

Archives