Hi, I’m starting to learn PG, and today, I tried an installation using Docker.
As I understand it, PostgreSQL defaults to SQL_ASCII encoding rather than UTF-8, for historical reasons.
This caused an error when creating a new database in pgAdmin, I had to select Template (template0) to avoid the error.
I figured I could probably initiate Postgres with default UTF-8
For this purpose I added the parameter LANG: en_US.utf8 .
Now everything works fine, but maybe there are some problems in the future?
My working configuration.
version: '3'
services:
postgres:
image: percona/percona-distribution-postgresql:16.2-multi
environment:
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: myuser
LANG: en_US.utf8
volumes:
- postgres:/var/lib/postgresql/data
pgadmin:
image: dpage/pgadmin4:8
environment:
PGADMIN_DEFAULT_EMAIL: admin@pgadmin.com
PGADMIN_DEFAULT_PASSWORD: mypgadminpassword
PGADMIN_LISTEN_PORT: 80
ports:
- 15432:80
volumes:
- pgadmin:/var/lib/pgadmin
depends_on:
- postgres
volumes:
postgres:
pgadmin: