On 17/06/19 12:35 AM, PG Bug reporting form wrote:
>
> IT is successful.
>
> Remove the running container, start again but use a postgres version later
> than 9.6. here I'm using "latest", pulled on June 16, 2019. note the
> commands below are identical to the example above except for the postgres
> docker image used.
>
> 1. Create container:
> docker run -i --detach --name lcj34__biohpc_phg_postgres_container -e
> POSTGRES_PASSWORD=phgP0stgr3s -v
> /workdir/lcj34/DockerPostgresTests_working/dockerDB_data/data:/var/lib/postgresql/data
> -p 8010:5432 postgres:latest
What I suspect is happening is this: the volume you used for the 9.6
container still has the database files there (even after the container
has stopped), so when you try to reuse it for a later version the new
postmaster will refuse to start. I suggest naming the volume path with a
version. e.g:
docker run -i --detach --name lcj34__biohpc_phg_postgres_container -e
POSTGRES_PASSWORD=phgP0stgr3s -v
/workdir/lcj34/DockerPostgresTests_working/dockerDB_data/10:/var/lib/postgresql/data
regards
Mark