Postgres and Pgcli

START PG

version: '2'

services:
  postgresql:
    container_name: pg
    image: postgres:12
    ports:
      - '5432:5432'
    volumes:
      - 'postgresql_data:/var/lib/postgresql/data'
    environment:
      - 'POSTGRES_PASSWORD=!Qsx4rgb'
      - 'PGDATA=/var/lib/postgresql/data/pgdata'

  # adminer:
  #   image: adminer
  #   restart: always
  #   ports:
  #     - 8080:8080

volumes:
  postgresql_data:
    driver: local

安装pgcli

sudo apt install libpq-dev
pip install -U pgcli
export PATH=$PATH:/home/ubuntu/.local/bin
pgcli -U postgres -h localhost

更改配置

postgres@localhost> alter system set autovacuum = off;
postgres@localhost> SELECT pg_reload_conf();
postgres@localhost> show autovacuum;