Skip to content

for the record: standard ubuntu/pgdg (non-docker) install notes #102

@r2evans

Description

@r2evans

Up front, I have used this image many times on multiple servers, both in docker and using pgdg-ppa installed packages; many thanks!

It's this last method (pgdg PPA) that requires slight mods.


This isn't a bug report, it's a note so that others experience similar problems, perhaps this can help.

Since the standard ubuntu mechanism is to store configuration in /etc/postgresql/13/main (using postgresql-13 as an example), all of its *.conf files are there instead of where (I believe) these images assume they can be found (within /var/lib/postgresql/13/data in this example). In order to get this image to work on an instance of postgresql installed from the pgdg PPA (https://apt.postgresql.org/...), I got errors about

User 'postgres' has no password assigned

After incorrectly diving into that error, I realized that the migration attempt was interrupted after some seemingly good-looking output. (I should read all the output before trying to continue forward.) All of the failing efforts were due to small differences between the "docker-contained postgresql" and one installed from the ppa. (Ergo this "issue".)

Additionally, for some reason my 13 installation was using /var/lib/postgresql/13/main instead of .../13/data, so I had that minor glitch to work around. (I don't know if that is from some much older migration path I've done over the years, or if it was normal at one point.)

These are all that I did in order to get the image to work (and work great it did):

  • copy all of the /etc/postgresql/13/main/*conf over to /var/lib/postgresql/13/data

  • many of those conf files referenced /etc/postgresql/..., so I had to edit in-place each of those to update the path

  • I had SSL configured in 13, so I had to disable all references in /var/lib/postgresql/13/main/postgresql.conf as well as postgresql.auto.conf if it was present and/or created in the process.

  • call docker using the two-directory example in the standard docs here:

    docker run --rm \
      -v /var/lib/postgresql/13/main:/var/lib/postgresql/13/data \
      -v /var/lib/postgresql/14/data:/var/lib/postgresql/14/data \
      tianon/postgres-upgrade:13-to-14
  • after that was done, I had to re-chown everything, as in

    chown -R postgres:postgres /var/lib/postgresql/13/ /var/lib/postgresql/14/

    This was necessary before attempting to restart the postgresql service, since the internal image chowns it to something else and doesn't change it back. Easy enough. (I found no perms changed, just the owner, so it seemed harmless enough.)

And not related to the ubuntu/pgdg-ppa thing, on the upgrade from 14-to-15 I needed to comment out stats_temp_directory in the conf file since it was removed starting in postgresql-15 (no harm).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions