-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom installed username #100
Comments
Does the username actually matter? The filesystem doesn't store the username -- I'm guessing it's actually complaining about the UID (not the username), and that passing |
It does seem to matter. Permissions are set correctly. Passing the correct --user fails identically. |
Do you have a full reproducer? (Just the conversion doesn't exactly help me reproduce.) |
I can comment broadly on the scenario I ran in to. The containers were databases for an OLD
NEW
The volume folders were created during the initial run of the container. This resulted in the error above. The next step I took, was to find the UID:GID of the data using the command you outlined. I then added In the It's very possible I also didn't do something correctly, but then again I am not sure why the fix would have worked for me either. |
We did run into the same scenario. Our Old DB hat a different username, However the newly Created DB has the "postgres" username (independent of the -U parameter). Workaroundwe used is passing the user and password trough to the initdb:
The last part is related to #1 as the initdb does not setup the NEW to be externally accessible we needed to add this (as it is also done in the Postgres Docker image). ReproducingThis should be easy to reproduce: create a new DB with the main User not being "postgres" (and not in trust mode). And try to migrate. |
Thank you @markus-kuepper. Your solution works for me, too. In the logs I see "database ... has no actual collation version, but a version was recorded" postgresql | postgresql | 2025-01-12 22:04:50.495 UTC [1] LOG: database system is ready to accept connections I think, I run into the issue described in https://blog.nuvotex.de/postgres-2/ ? I indeed use postgresql:<version>-alpine |
Based on https://github.com/tianon/docker-postgres-upgrade/blob/master/16-to-17/Dockerfile and https://github.com/tianon/docker-postgres-upgrade/blob/master/16-to-17/docker-upgrade docker-upgrade contains the solution from @markus-kuepper. The switch to alpine indeed solved the "database has no actual collation version, but a version was recorded." I would be really glad if the changes were integrated into the official image. To run it:
The Dockerfile to upgrade from postgresql 16 to 17:
The docker-upgrade:
|
I just found this #108 (comment) . |
The Dockerfile to upgrade from postgresql 16 to 17 with timescaledb: The docker-upgrade is the same from #100 (comment). Important: timescale/timescaledb:latest-pg17 comes only with timescaledb 2.17 therefore upgrade to timescaledb 2.17 before you upgrade postgresql.
|
Reproduce
Able to migrate from old postgresql db which has a custom installed username .
Current
It fails with
database user "postgres" is not the install user
:With
--username=somecustomusername
it fails withFATAL: role "somecustomusername" does not exist
:Reason
Hardcoded username
postgres
.E.g.
docker-postgres-upgrade/13-to-16/Dockerfile
Line 26 in 5ac0d88
Workaround
Edit the
Dockerfile
:The text was updated successfully, but these errors were encountered: