docs
docs copied to clipboard
Tell the reader where the unix socket is
Someone reading the docs will otherwise need to go searching for further detail, or run it up, and exec, or some other needlessly convoluted meh.
We just use the package default (which upstream sets and could change). So it is best to just ask postgres what it is. Something like: postgres --describe-config | grep unix_socket_directories
.
But why is the socket path needed in the context of running psql
commands from an inidb.d
script? psql
just does the right thing and connects though the socket. The entrypoint script doesn't do anything spoecial: https://github.com/docker-library/postgres/blob/e8cb2acbb372f0c89219792f82b0bdd2e405602f/docker-entrypoint.sh#L175-L187. And that function docker_process_sql
can be used from an initdb.d
shell script (if it is non-executable, it will be sourced and so have access to any of the docker_
and pg_
functions).
not every user is only using psql in the initdb scripts (it turns out)
but if there's a better way to do this, then that should be in the docs :)
Sorry, but we try to avoid documenting things that are generic to upstream (and not otherwise specific or different for the container images), especially because our space/user attention is really limited.