Re: [HACKERS] Adding type info etc for inheritance errmsg: "child table is missing column ..."

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Adding type info etc for inheritance errmsg: "child table is missing column ..."
Дата
Msg-id 7663.1483816518@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Adding type info etc for inheritance errmsg: "childtable is missing column ..."  (Ryan Murphy <ryanfmurphy@gmail.com>)
Ответы Re: [HACKERS] Adding type info etc for inheritance errmsg: "childtable is missing column ..."  (Ryan Murphy <ryanfmurphy@gmail.com>)
Re: [HACKERS] Adding type info etc for inheritance errmsg: "childtable is missing column ..."  (Vik Fearing <vik@2ndquadrant.fr>)
Список pgsql-hackers
Ryan Murphy <ryanfmurphy@gmail.com> writes:
> So I tried using format_type_with_typemod() thinking that the "typemod
> info" meant things like NOT NULL, DEFAULT etc.

No, it means atttypmod, which stores info like the max length for
varchar(n).

> when I was hoping for
> user=# alter table temp inherit entity;
> ERROR:  child table is missing column "id" uuid default uuid_generate_v1mc()
> Is there an easy way to get the string that includes all those additional
> constraints/defaults etc?

No, and TBH I would vote strongly against including that much detail in
this error message anyway.  That info could be indefinitely long, and it's
not especially relevant to the stated error condition --- for example, the
presence of a default is *not* relevant to whether the column matches the
parent.  I'm okay with shoehorning column type into this message, but not
much more than that.
        regards, tom lane



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

Предыдущее
От: Ryan Murphy
Дата:
Сообщение: Re: [HACKERS] Adding type info etc for inheritance errmsg: "childtable is missing column ..."
Следующее
От: Ryan Murphy
Дата:
Сообщение: Re: [HACKERS] Adding type info etc for inheritance errmsg: "childtable is missing column ..."