Collation upgrade
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.
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?
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.
Yeah, that's a fair point. Go would be my preferred language for this too. :smile: