pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make error hint from bind() failure more accurate
Date: Wed, 25 Nov 2020 07:42:16 +0000
Message-ID: <E1khpRQ-0000Uy-JN@gemulon.postgresql.org> (raw)

Make error hint from bind() failure more accurate

The hint "Is another postmaster already running ..." should only be
printed for errors that are really about something else already using
the address.  In other cases it is misleading.  So only show that hint
if errno == EADDRINUSE.

Also, since Unix-domain sockets in the file-system namespace never
report EADDRINUSE for an existing file (they would just overwrite it),
the part of the hint saying "If not, remove socket file \"%s\" and
retry." can never happen, so remove it.  Unix-domain sockets in the
abstract namespace can report EADDRINUSE, but in that case there is no
file to remove, so the hint doesn't work there either.

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/flat/6dee8574-b0ad-fc49-9c8c-2edc796f0033@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d5d91acdccae6b322a5634be2c66d62fc6b9a43d

Modified Files
--------------
src/backend/libpq/pqcomm.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)



Message-ID: <E1khpRQ-0000Uy-JN@gemulon.postgresql.org>
Permalink:  ../E1khpRQ-0000Uy-JN@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1khpRQ-0000Uy-JN@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Make error hint from bind() failure more accurate
  In-Reply-To: <E1khpRQ-0000Uy-JN@gemulon.postgresql.org>
  References: <E1khpRQ-0000Uy-JN@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox