Re: wrong relkind error messages
| От | Alvaro Herrera |
|---|---|
| Тема | Re: wrong relkind error messages |
| Дата | |
| Msg-id | 20200414230208.GA27948@alvherre.pgsql обсуждение исходный текст |
| Ответ на | Re: wrong relkind error messages (Robert Haas <robertmhaas@gmail.com>) |
| Ответы |
Re: wrong relkind error messages
Re: wrong relkind error messages |
| Список | pgsql-hackers |
On 2020-Apr-13, Robert Haas wrote:
> + ereport(ERROR,
> + (errcode(ERRCODE_WRONG_OBJECT_TYPE),
> + errmsg("action cannot be performed on relation \"%s\"",
> + RelationGetRelationName(rel)),
>
> Super-vague.
Maybe, but note that the patch proposed to replace this current error
message:
ERROR: foo is not an index or foreign table
with
ERROR: action cannot be performed on "foo"
DETAIL: "foo" is a materialized view.
or, if we're to adopt Tom's proposed wording,
ERROR: cannot perform action on relation "ti"
DETAIL: This operation is not supported for materialized views.
so it's not like this is making things any worse; the error was already
super-vague.
This could be improved if we had stringification of ALTER TABLE
subcommand types:
ERROR: ALTER TABLE ... ADD COLUMN cannot be performed on "foo"
DETAIL: "foo" is a gummy bear.
or
ERROR: ALTER TABLE ... ADD COLUMN cannot be performed on foo
DETAIL: This action cannot be performed on gummy bears.
but that seems material for a different patch.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: