Re: Unclear error message

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Unclear error message
Дата
Msg-id 20180921051707.GK1338@paquier.xyz
обсуждение исходный текст
Ответ на Unclear error message  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: Unclear error message  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-hackers
On Thu, Sep 20, 2018 at 09:45:09PM +0200, Laurenz Albe wrote:
> 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))));

Hmm...  There are no test cases for this error message, nor for the one
below "cannot add NOT VALID foreign key to relation foo", which is a bad
idea.

The referenced relation has to be RELKIND_RELATION.  Here is another
idea of error message:
cannot use ONLY on partitioned table "foo" with foreign key
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: transction_timestamp() inside of procedures
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Function to promote standby servers