pgsql
| Name | Latest |
|---|---|
| docker.io/library/postgres:15.19-alpine | 15.19 |
| docker.io/prometheuscommunity/postgres-exporter:v0.20.1 | v0.20.1 |
Install
bash
docker compose --project-name pgsql --file compose.yml up --detach --remove-orphansCreate Extension
sql
CREATE EXTENSION "uuid-ossp";Conf pg_hba.conf 允许任意地址访问
text
# TYPE DATABASE USER ADDRESS METHOD
host all all 0.0.0.0/0 md5User
Create User and set role
sql
CREATE USER <username> WITH PASSWORD '<password>';
alter role <username> superuser;
drop role <username>;