Unclear error message

Поиск
Список
Период
Сортировка
Искать
От
Laurenz Albe
Тема
Unclear error message
Дата
Msg-id
c11c05810a9ed65e9b2c817a9ef442275a32fe80.camel@cybertec.at
Список
Дерево обсуждения
Unclear error message Laurenz Albe <laurenz.albe@cybertec.at>
Re: Unclear error message Michael Paquier <michael@paquier.xyz>
Re: Unclear error message Laurenz Albe <laurenz.albe@cybertec.at>
Re: Unclear error message Michael Paquier <michael@paquier.xyz>
Re: Unclear error message Michael Paquier <michael@paquier.xyz>
Re: Unclear error message Laurenz Albe <laurenz.albe@cybertec.at>
Re: Unclear error message Michael Paquier <michael@paquier.xyz>
In backend/commands/tablecmds.c, function ATAddForeignKeyConstraint, I find:

if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
{
    if (!recurse)
        ereport(ERROR,
                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
                 errmsg("foreign key referencing partitioned table \"%s\" must not be ONLY",
                        RelationGetRelationName(pkrel))));

That message is wrong, because "rel" and not "pkrel" is the partitioned table.
I think it should be

        ereport(ERROR,
                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
                 errmsg("foreign key cannot be defined on ONLY \"%s\" for a partitioned table",
                        Relatio
nGetRelationName(rel))));

Yours,
Laurenz Albe


В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: Christoph Berg
Дата:
Сообщение: Re: [patch] Support LLVM 7
FAQ