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

Collation upgrade

Open uejo opened this issue 3 months ago • 3 comments

When performing an Upgrade of base images it would also be nice to automatically rebuild the indices. Probably related to glibc, see https://github.com/pgautoupgrade/docker-pgautoupgrade/issues/89.

Currently it seems the reindex only appears if a postgres major upgrade is performed. But since https://github.com/pgautoupgrade/docker-pgautoupgrade/issues/79 this seems also necessary when the base changes eg from debian 12 to 13.

uejo avatar Sep 17 '25 12:09 uejo

The "whether to reindex or not" decision seems to be a bit trickier than everyone would like.

Perhaps we should take a different approach and reindex everything every time by default?

justinclift avatar Sep 17 '25 22:09 justinclift

Perhaps we should take a different approach and reindex everything every time by default?

I mean 99% of the starts you won't need that.

We likely could just upgrade the collation if detected on each start, but also something could potentially break. see #108 for more complexity on the issue.


Problem is with all these requirements is that the bash script gets more complex, to point where I am wondering if a rewrite is appropriate at some point. maybe the pgautoupgrade logic could be extracted into a Go binary which could:

  • tracks the Postgres version and base OS in the Postgres data directory, maybe even if it is "plain" Postgres or Bitnami flavour.
  • can take appropriate actions when Postgres version or Base OS changes. Sometimes Postgres point releases require an action, which this binary would know about and can execute.

andyundso avatar Sep 18 '25 19:09 andyundso

Yeah, that's a fair point. Go would be my preferred language for this too. :smile:

justinclift avatar Sep 19 '25 04:09 justinclift