This allows for a more graceful error message for the case of users who need to update their volume path.
I tested this with 17 and `--env PGDATA=/var/lib/postgresql/17/docker` (to make sure it still works fine and doesn't complain about the extra volume provided by Docker/`VOLUME`) and 18 with `-v /var/lib/postgresql/data` (where it appropriately errors and explains to me what I should be doing instead).
I also did a reflow on some text in the error message that's designed to fit in 80 columns but was taking 81. 😂
This is a bit complicated to use in Docker (because `io_uring` has a long and storied security story), but it is a new feature of 18+ that we should probably explicitly support for users who want to jump through the hoops to use it despite the security risk.
Additionally, this re-alphabetizes our `--with-xxx` flags.
See:
- eaa9529d8e
"Make LLVM architectures a inclusion list so it works in the Architecture field."
(which removes i386, notably)
- 1d6f624592
"Disable JIT on loong64 and riscv64 again, still segfaulting."
This is a pretty large breaking change, which is why this only makes the change in 18+ (which is currently in pre-release stages, and not due for GA until September, and pre-release `PGDATA` directories are officially *not supported* on the GA release anyhow).
Concretely, this changes `PGDATA` to `/var/lib/postgresql/MAJOR/docker`, which matches the pre-existing convention/standard of the `pg_ctlcluster`/`postgresql-common` set of commands, and frankly is what we should've done to begin with, in a classic case of Chesterton's Fence (https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence).
This also changes the `VOLUME` to `/var/lib/postgresql`, which should be more reasonable, and make the upgrade constraints more obvious.
For any users who have been testing the pre-releases, the simplest way to keep your existing data directory is going to be to add `PGDATA=/var/lib/postgresql/data` as an environment variable on your container or adjust your bind-mount from `/var/lib/postgresql/data` to `/var/lib/postgresql/18/docker`, but the *best* way is going to be to refactor your host directory such that your data lives at `18/docker` inside and you can then mount directly to `/var/lib/postgresql` (possibly setting `PGDATA=/var/lib/postgresql/MAJOR/docker` as well, if you want to go overboard on being explicit).
When we added these lines, we needed newer files than PostgreSQL had upstream, but the situation has changed and we were pinned to a specific commit from 2017 - the _oldest_ PostgreSQL release version has a file from 2020.
* Unset NOTIFY_SOCKET when running the temporary server.
Postgres has native support for this notification socket and will write a `READY=1` message once it is ready and accepting connections. Unfortunately, the temporary server used by the `docker-entrypoint.sh` also sends a message on the socket, making it appear as though the container is ready and serving connections when it is not.