redundant error messages - Mailing list pgsql-hackers

From Peter Eisentraut
Subject redundant error messages
Date
Msg-id 3e937641-88a1-e697-612e-99bba4b8e5e4@enterprisedb.com
Whole thread Raw
Responses Re: redundant error messages  (Euler Taveira <euler.taveira@2ndquadrant.com>)
Re: redundant error messages  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-hackers
A few client tools duplicate error messages already provided by libpq, 
such as

pg_rewind: fatal: could not connect to server: could not connect to 
server: No such file or directory

pg_basebackup: error: could not connect to server: could not connect to 
server: No such file or directory

psql: error: could not connect to server: could not connect to server: 
No such file or directory

The psql case is actually a regression introduced in PG12, but the other 
two appear to be ancient.

Other client tools provide a different error message so in aggregate it 
looks like this:

createdb: error: could not connect to database template1: could not 
connect to server: No such file or directory

The attached patch removes the redundant message from the client tools. 
I suppose it's a bit dubious because there is no guarantee what the 
level of detail the message supplied by libpq has.  But I think these 
few cases are not particularly hard to keep in sync.

Attachment

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM
Next
From: Michael Paquier
Date:
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM