============== starting postmaster                    ==============
running with PID 30235; connect with:
  psql "host='/tmp/pg_regress-j74yFE' port=50848 dbname='regression'"
============== creating database "regression"         ==============


On 28 August 2017 at 14:08, Michael Paquier <michael.paqu...@gmail.com>
wrote:

> On Mon, Aug 28, 2017 at 2:28 PM, Craig Ringer <cr...@2ndquadrant.com>
> wrote:
> > It's a pain having to find the postmaster command line to get the port
> > pg_regress started a server on. We print the port in the pg_regress
> output,
> > why not the socket directory / host?
> >
> > How about
> > running on 'port=50848 host=/tmp/pg_regress-UMrcT3' with PID 16409
> >
> > per the attached?
> >
> > If you'd prefer nicer wording at the expense of two lines, maybe
> >
> > running with PID 16409
> > connection string: 'port=50848 host=/tmp/blah'
>
> Yeah, I think that this is a good idea.
> --
> Michael
>



-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
From c3613d4526ba04fb18011e2af1923b9a167effec Mon Sep 17 00:00:00 2001
From: Craig Ringer <cr...@2ndquadrant.com>
Date: Mon, 28 Aug 2017 13:28:05 +0800
Subject: [PATCH v2] Show sockdir/hostname in pg_regress startup output

---
 src/test/regress/pg_regress.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index abb742b..4cccefc 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2438,8 +2438,10 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
 #else
 #define ULONGPID(x) (unsigned long) (x)
 #endif
-		printf(_("running on port %d with PID %lu\n"),
-			   port, ULONGPID(postmaster_pid));
+		printf(_("running with PID %lu; connect with:\n"),
+ 			   ULONGPID(postmaster_pid));
+		printf(gettext_noop("  psql \"host='%s' port=%d dbname='%s'\"\n"),
+			   hostname ? hostname : sockdir, port, dblist->str);
 	}
 	else
 	{
-- 
2.9.5

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to