Skip to content

How to access postgres from host #298

Closed Answered by silviogutierrez
Itisfilipe asked this question in Q&A
Discussion options

You must be logged in to vote

So it uses a socket file to avoid binding to ports. To see the right socket file, just run export inside the activated shell and you should see PGHOST.

You can then connect to that. It should not need any authentication. The database name is database and you may need to specify port 1 if required.

Example:

[nix-shell:~/Sites/silviogutierrez/silviogutierrez.com/main]$ export | grep PGHOST
declare -x PGHOST="/tmp/reactivated/ff657f1d3a00ad59e7833de1de612408"

And using TablePlus:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by silviogutierrez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #297 on September 19, 2023 00:03.