From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: wrong relkind error messages
Date: Tue, 14 Apr 2020 18:36:25 -0400
Message-ID: <20200414223625.GA26246@alvherre.pgsql> (raw)
In-Reply-To: <20200414013238.GE1492@paquier.xyz>
On 2020-Apr-14, Michael Paquier wrote:
> On Mon, Apr 13, 2020 at 11:13:15AM -0400, Tom Lane wrote:
> > ERROR: cannot define statistics for relation "ti"
> > DETAIL: This operation is not supported for indexes.
> >
> > which still leaves implicit that "ti" is an index, but probably that's
> > something the user can figure out.
> >
> > Maybe someone else can do better?
>
> "This operation is not supported for put_relkind_here \"%s\"."? I
> think that it is better to provide a relation name in the error
> message (even optionally a namespace). That's less to guess for the
> user.
But the relation name is already in the ERROR line -- why do you care so
much about also having it in the DETAIL? Besides, I think part of the
point Tom was making is that if you say "not supported for the index
foo" is that the user is left wondering whether the operation is not
supported for that particular index only or for any index.
Tom's other proposal
> > DETAIL: "ti" is an index, and this operation is not supported for that kind of relation.
addresses that problem, but seems excessively verbose.
Also, elsewhere Peter said[1] that we should not try to list the things
that would be allowed, so it's pointless to try to list the relkinds for
which the operation is permissible.
So I +1 this idea:
ERROR: cannot define statistics for relation "ti"
DETAIL: This operation is not supported for indexes.
[1] https://www.postgresql.org/message-id/1293803569.19789.6.camel%40fsopti579.F-Secure.com
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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@2ndquadrant.com, michael@paquier.xyz, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com
Subject: Re: wrong relkind error messages
In-Reply-To: <20200414223625.GA26246@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