Re: strange error reporting

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: strange error reporting
Date: 2021-05-03 10:08:04
Message-ID: 0621c8e2-6b87-219d-2eaf-ae1a2cb822b2@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21.01.21 02:33, Tom Lane wrote:
>>> I'd be inclined to spell it "connection to server at ... failed",
>>> but that sort of wording is surely also possible.
>
>> "connection to server" rather than "connection to database" works for
>> me; in fact, I think I like it slightly better.
>
> If I don't hear any other opinions, I'll change these messages to
>
> "connection to server at socket \"%s\" failed:"
> "connection to server at \"%s\" (%s), port %s failed:"
>
> (or maybe "server on socket"? "at" sounds right for the IP address
> case, but it feels a little off in the socket pathname case.)

I was just trying some stuff with PG14, which led me to this thread.

I find these new error messages to be more distracting than before in
some cases. For example:

PG13:

clusterdb: error: could not connect to database typo: FATAL: database
"typo" does not exist

PG14:

clusterdb: error: connection to server on socket "/tmp/.s.PGSQL.65432"
failed: FATAL: database "typo" does not exist

Throwing the socket address in there seems a bit distracting and
misleading, and it also pushes off the actual information very far to
the end. (Also, in some cases the socket path is very long, making the
actual information even harder to find.) By the time you get to this
error, you have already connected, so mentioning the server address
seems secondary at best.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-05-03 12:18:14 Re: Replication slot stats misgivings
Previous Message Pavel Stehule 2021-05-03 09:35:34 Re: how to correctly cast json value to text?