docs icon indicating copy to clipboard operation
docs copied to clipboard

Tell the reader where the unix socket is

Open SvenDowideit opened this issue 4 years ago • 2 comments

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.

SvenDowideit avatar Feb 03 '21 22:02 SvenDowideit

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).

yosifkit avatar Feb 04 '21 00:02 yosifkit

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 :)

SvenDowideit avatar Feb 04 '21 00:02 SvenDowideit

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.

tianon avatar Dec 20 '23 21:12 tianon