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

Поиск
Список
Период
Сортировка
От Ryan Murphy
Тема [HACKERS] Adding type info etc for inheritance errmsg: "child table is missingcolumn ..."
Дата
Msg-id CAHeEsBc95C6=Sce_5nLuv66EEs2=8B7WPNofm6=3A581QxHwXw@mail.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
Hey Postgres team!

I've been gleefully using the inheritance feature of Postgres for the last 6 months or so, and it's really great!  I especially like how easily you can ALTER TABLE foo INHERIT bar, and get helpful error messages about what columns need to be there before the inherit can take place.

One thing that seemed helpful to me is if it not only told you that you're missing the attribute, but also told you the type, and perhaps even the constraints, so you can easily make the column match up with the one you're inheriting.  Otherwise you may add the wrong type of column and end up with a "column is the wrong type" error.

The attached patch is my initial attempt at adding the type, making the error message read e.g.:

ERROR: child table is missing column "name" text

I'm sure it needs work (in particular I borrowed a lot of the get-type-name logic from getTypeOutputInfo() so probably needs a factor), and I'd ultimately love for it to list NOT NULL, DEFAULTs and other constraints to make it easier to prepare a table to inherit from another.

Thoughts / suggestions?  Does this seem useful to you guys?

Best,
Ryan
Вложения

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

Предыдущее
От: Kuntal Ghosh
Дата:
Сообщение: Re: [HACKERS] Incorrect XLogRegisterBuffer flag for revmapbuf in brin
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] [WIP]Vertical Clustered Index (columnar storeextension)