Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up\H prompt variable shows /tmp for unix domain socket connection #963
Labels
Comments
|
Thank you for the bug report! |
|
Well, In that regard, |
|
Perhaps - I don't have a strong opinion on this one. :) In case you'd like to take a stab at fixing it, here is the relevant code: Lines 888 to 903 in 589c2ab |
|
That should be it: @@ -891,9 +891,13 @@
string = string.replace('\\t', self.now.strftime('%x %X'))
string = string.replace('\\u', self.pgexecute.user or '(none)')
host = self.pgexecute.host or '(none)'
- string = string.replace('\\H', host)
- short_host, _, _ = host.partition('.')
- string = string.replace('\\h', short_host)
+ if self.pgexecute.get_socket_directory() == host:
+ string = string.replace('\\H', '[local]')
+ string = string.replace('\\h', '[local]')
+ else:
+ string = string.replace('\\H', host)
+ short_host, _, _ = host.partition('.')
+ string = string.replace('\\h', short_host)
string = string.replace('\\d', self.pgexecute.dbname or '(none)')
string = string.replace('\\p', str(
self.pgexecute.port) if self.pgexecute.port is not None else '5432') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


pgcli shows
/tmpfor unix domain socket connections (prompt is\u@\H:\p/\d dbcli>).psqlshows[local]instead.Port shows as 5432 while it probably should be "(none)" since domain sockets don't have ports.
psqlalso shows5432.