Re: Local partitioned indexes and pageinspect - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Local partitioned indexes and pageinspect
Date
Msg-id CA+TgmoabZsy3zk4db0RSWbdLCcAq7FS80P9ZWcj+gLeSi7nrew@mail.gmail.com
Whole thread Raw
In response to Re: Local partitioned indexes and pageinspect  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Local partitioned indexes and pageinspect  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Mon, Apr 30, 2018 at 2:50 AM, Michael Paquier <michael@paquier.xyz> wrote:
> On Sun, Apr 29, 2018 at 06:20:02PM -0700, Peter Geoghegan wrote:
>> What about amcheck? I did change the example query in the docs to
>> account for this, so anyone that generalizes from that won't have a
>> problem, but it would be nice if it had a friendlier message. I didn't
>> change amcheck to account for this myself because I thought it was
>> possible that somebody else would want to use a more general solution.
>
> Perhaps it would help if an errhint is added which is written as "This
> relation is a %s", where %s is a relkind converted to a translatable
> string describing the kind?  All those modules work on different objects
> and have different goals and prospoectives, so it looks difficult to me
> to come up with a sane API which is rather portable across modules.

That's probably going to cause some translation problems.  The form of
"a" that you need will vary: "a" vs. "an" in English, "un" vs. "una"
in Spanish, etc.  And it wouldn't be surprising if there are problems
in some languages even if you make it "This relation is %s".  There's
a reason why the documentation advises against building up
translatable strings from constituent parts.  If we go this route,
it's probably best to separately translate "This relation is a
table.", "This relation is an index.", etc.

However, backing up a minute, I don't think "relation \"%s\" is not a
btree index" is such a terrible message.  These modules are intended
to be intended by people who Know What They Are Doing.  If we do want
to change the message, I submit that the only thing that makes it a
little unclear is that a user might fail to realize that a partitioned
index is not an index.  But that could be fixed just by adding a
separate message for that one case (index \"%s\" is partitioned) and
sticking with the existing message for other cases.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Stas Kelvich
Date:
Subject: Global snapshots
Next
From: Andres Freund
Date:
Subject: Re: Is a modern build system acceptable for older platforms