Make pg_regress print a connstring with sockdir
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t37312psql -h localhost -U postgresBuilt from patchset v3 (message #3), July 27, 2026 at 10:35 PM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t37312_3 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t37312_3 && git checkout t37312_3Patchset v3 (message #3) is on t37312_3
Hi all
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'
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Attachments:
v1-0001-Show-sockdir-hostname-in-pg_regress-startup-outpu.patchtext/x-patch; charset=US-ASCII; name=v1-0001-Show-sockdir-hostname-in-pg_regress-startup-outpu.patchDownload+3-3
On Mon, Aug 28, 2017 at 2:28 PM, Craig Ringer <craig@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 16409per 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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
============== 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.paquier@gmail.com>
wrote:
On Mon, Aug 28, 2017 at 2:28 PM, Craig Ringer <craig@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_regressoutput,
why not the socket directory / host?
How about
running on 'port=50848 host=/tmp/pg_regress-UMrcT3' with PID 16409per 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
On Mon, Aug 28, 2017 at 4:07 PM, Craig Ringer <craig@2ndquadrant.com> wrote:
============== starting postmaster ==============
running with PID 30235; connect with:
psql "host='/tmp/pg_regress-j74yFE' port=50848 dbname='regression'"
============== creating database "regression" ==============
Sorry if my words were confusing and have cost you three minutes of
development. I like better the one-line version :)
Now a socket path could be quite long. I can live with that personally.
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 28 August 2017 at 15:19, Michael Paquier <michael.paquier@gmail.com>
wrote:
On Mon, Aug 28, 2017 at 4:07 PM, Craig Ringer <craig@2ndquadrant.com>
wrote:============== starting postmaster ==============
running with PID 30235; connect with:
psql "host='/tmp/pg_regress-j74yFE' port=50848 dbname='regression'"
============== creating database "regression" ==============Sorry if my words were confusing and have cost you three minutes of
development. I like better the one-line version :)
Now a socket path could be quite long. I can live with that personally.
I'm not fussed, I just think we should show it one way or the other.
One nice thing about the two line form is that you can
double-click/middle-click to open a new psql in the pg_regress session
pretty much instantly.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Craig Ringer wrote:
On 28 August 2017 at 15:19, Michael Paquier <michael.paquier@gmail.com>
wrote:On Mon, Aug 28, 2017 at 4:07 PM, Craig Ringer <craig@2ndquadrant.com>
wrote:============== starting postmaster ==============
running with PID 30235; connect with:
psql "host='/tmp/pg_regress-j74yFE' port=50848 dbname='regression'"
============== creating database "regression" ==============Sorry if my words were confusing and have cost you three minutes of
development. I like better the one-line version :)
Now a socket path could be quite long. I can live with that personally.I'm not fussed, I just think we should show it one way or the other.
One nice thing about the two line form is that you can
double-click/middle-click to open a new psql in the pg_regress session
pretty much instantly.
So don't add gettext_noop() around it :-)
--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
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?
I'm not following the point here. The test postmaster isn't really
going to be around long enough to connect to it manually. If you
want to do that, you should be using "installcheck", and then the
problem doesn't arise.
The reason for printing the port number, if memory serves, is to
aid in debugging port selection conflicts. That doesn't really
apply for temporary socket directories; we're expecting libc to
avoid any conflicts there.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 28 August 2017 at 19:45, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Craig Ringer <craig@2ndquadrant.com> writes:
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_regressoutput,
why not the socket directory / host?
I'm not following the point here. The test postmaster isn't really
going to be around long enough to connect to it manually. If you
want to do that, you should be using "installcheck", and then the
problem doesn't arise.The reason for printing the port number, if memory serves, is to
aid in debugging port selection conflicts. That doesn't really
apply for temporary socket directories; we're expecting libc to
avoid any conflicts there.
I'm frequently debugging postmasters that are around long enough.
Deadlocks, etc.
It's also way easier to debug shmem related issues with a live postmaster
vs a core.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
On Mon, Aug 28, 2017 at 7:57 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
I'm frequently debugging postmasters that are around long enough. Deadlocks,
etc.It's also way easier to debug shmem related issues with a live postmaster vs
a core.
Yeah. I don't *frequently* debug postmasters that hang during the
regression tests, but I definitely have done it, and I think something
like this would make it easier. Right now if something wedges and you
need to connect to the postmaster to see what's going on, you have to
grep for the pid, then lsof to get the socket directory. This would
simplify things.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers