Re: abstract Unix-domain sockets - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: abstract Unix-domain sockets
Date
Msg-id bfcf56d5-58b1-ef4a-6a27-6c9d4cbfc103@2ndquadrant.com
Whole thread Raw
In response to Re: abstract Unix-domain sockets  (Michael Paquier <michael@paquier.xyz>)
Responses Re: abstract Unix-domain sockets  (Michael Paquier <michael@paquier.xyz>)
List 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/



pgsql-hackers by date:

Previous
From: Georgios Kokolatos
Date:
Subject: Re: Supporting = operator in gin/gist_trgm_ops
Next
From: Peter Eisentraut
Date:
Subject: Re: Clean up optional rules in grammar