Re: abstract Unix-domain sockets

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: abstract Unix-domain sockets
Date: 2020-11-11 12:39:17
Message-ID: bfcf56d5-58b1-ef4a-6a27-6c9d4cbfc103@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-11-10 07:24, Michael Paquier wrote:
>> Can you sketch how you would structure this? I realize it's not very
>> elegant, but I couldn't come up with a better way that didn't involve having
>> to duplicate some of the error messages into multiple branches.
>
> I think that I would use a StringInfo to build each sentence of the
> hint separately. The first sentence, "Is another postmaster already
> running on port %d?" is already known. Then the second sentence could
> be built depending on the two other conditions.

I'm not sure concatenating sentences like that is okay for translatability.

> FWIW, I think that it
> is confusing to mention in the hint to remove a socket file that
> cannot be removed.

Thinking about it further, I think the hint in the Unix-domain socket
case is bogus. A socket in the file-system namespace never reports
EADDRINUSE anyway, it just overwrites the file. For sockets in the
abstract namespace, you can get this error, but of course there is no
file to remove.

Perhaps we should change the hint in both the Unix and the IP cases to:

"Is another postmaster already running at this address?"

(This also resolves the confusing reference to "port" in the Unix case.)

Or we just drop the hint in the Unix case. The primary error message is
clear enough.

--
Peter Eisentraut
2ndQuadrant, an EDB company
https://www.2ndquadrant.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-11-11 12:40:31 Re: Clean up optional rules in grammar
Previous Message Georgios Kokolatos 2020-11-11 12:33:11 Re: Supporting = operator in gin/gist_trgm_ops