docker-pgautoupgrade icon indicating copy to clipboard operation
docker-pgautoupgrade copied to clipboard

Error while upgrading to 17 from 14

Open Idosegal opened this issue 2 months ago • 4 comments

hi, I’m getting the following error when upgrading from 14 to 17. mv: cannot move '/var/lib/postgresql/data/old' to a subdirectory of itself, '/var/lib/postgresql/data/old/old'

The PGDATA is /var/lib/postgresql/data Also the upgrade process continued, and seems like it completed successfully.

Can someone please explain this?

Idosegal avatar Oct 27 '25 16:10 Idosegal

did you perhaps had another error before this one that made pgautoupgrade abort? that would explain why there is already an old directory.

as for the warning itself, I think this is nothing harmful, mv, as explained, cannot move things into itself.

andyundso avatar Oct 27 '25 20:10 andyundso

No I didn't. It seems like the old dir created in my pgdata folder (which contains all files PG_VERSION etc.) Then the mv command try to move the files within that folder, an and the old dir itself also.

Idosegal avatar Oct 28 '25 18:10 Idosegal

The pgdata folder is my Postgres data folder, I'm providing it to the pgautoupgrade, as the data folder then it creates an old directory and the command which moving the files in the pgdata directory trying to move also the /old into itself.

I'm missing something?

Idosegal avatar Oct 31 '25 07:10 Idosegal

The issue comes from the mv -v "${PGDATA}"/* "${OLD}" line, as old/ already exists, it is expanded by the wildcard. The mv of old/ itself is not performed, so this is harmless but it would be cleaner to exclude old/ itself from the moves.

dwyart avatar Nov 13 '25 10:11 dwyart