pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Isaac Morland <isaac.morland@gmail.com>
Cc: Euler Taveira <euler.taveira@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: redundant error messages
Date: Thu, 5 Nov 2020 12:53:56 -0300
Message-ID: <20201105155356.GA17113@alvherre.pgsql> (raw)
In-Reply-To: <CAMsGm5dnrs69WMq3GK8f5BEWifVh1VVs3kpY2mMCv9PeuBu==g@mail.gmail.com>

On 2020-Nov-05, Isaac Morland wrote:

> In principle, the client knows the database name. In practice, if it's
> coming from PGDATABASE or via a service configuration, one may be confused
> about the database; having the error message be explicit will avoid many
> problems. I can easily imagine that "unable to connect to database" would
> be mystifying, whereas "unable to connect to database foo" would elicit the
> response, "wait, I'm trying to connect to what now?" leading much more
> quickly to a resolution.

Also consider cases like running something via cron, where the person
reading the error output does not necessarily know what command is being
run: it might be hidden inside a script.  It's often very helpful to
have object names in error messages, even if for the normal usage it
seems that the object being operated on is very obvious by just looking
at the command.





view thread (5+ messages)  latest in thread

Message-ID: <20201105155356.GA17113@alvherre.pgsql>
Permalink:  ../20201105155356.GA17113@alvherre.pgsql/
Also on:    postgresql.org/message-id/20201105155356.GA17113@alvherre.pgsql

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, isaac.morland@gmail.com, euler.taveira@2ndquadrant.com, peter.eisentraut@enterprisedb.com
  Subject: Re: redundant error messages
  In-Reply-To: <20201105155356.GA17113@alvherre.pgsql>

* 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