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 ..."
Дата
Msg-id CAHeEsBfvykrNeengd95kNX5oDUYVjDjfTcMLCApM-tOp1vd6mA@mail.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: "child table is missing column ..."  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

Thanks Tom, I'll redo the patch using one of those, and get back to you guys.


So I tried using format_type_with_typemod() thinking that the "typemod info" meant things like NOT NULL, DEFAULT etc.  It builds and includes the plain type but not all that stuff.  E.g.

user=# alter table temp inherit entity;
ERROR:  child table is missing column "id" uuid

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?  I noticed that defaults seem to be stored in the Form_pg_attrdef struct defined in src/include/catalog/pg_attrdef.h, and haven't yet seen how constraints like NOT NULL are handled.

Thanks,
Ryan

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Replication/backup defaults
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Adding type info etc for inheritance errmsg: "child table is missing column ..."