Re: Attached partition not considering altered column properties ofroot partition.

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Attached partition not considering altered column properties ofroot partition.
Дата
Msg-id 20190726221656.GA17989@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Attached partition not considering altered column properties ofroot partition.  (Amit Langote <amitlangote09@gmail.com>)
Ответы Re: Attached partition not considering altered column properties ofroot partition.  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
On 2019-Jul-03, Amit Langote wrote:

> Thanks for the report.  This seems like a bug.  Documentation claims
> that the child tables inherit column storage options from the parent
> table.  That's actually enforced in only some cases.

> To fix this, MergeAttributesIntoExisting() should check that the
> attribute options of a child don't conflict with the parent, which the
> attached patch implements.  Note that partitioning uses the same code
> as inheritance, so the fix applies to it too.  After the patch:

Thanks for the patch!

I'm not completely sold on back-patching this.  Should we consider
changing it in 12beta and up only, or should we just backpatch it all
the way back to 9.4?  It's going to raise errors in cases that
previously worked.

On the patch itself: I think ERRCODE_DATATYPE_MISMATCH is not the
correct one to use for this; maybe ERRCODE_INVALID_OBJECT_DEFINITION or,
more likely, ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE.

"FOO versus BAR" does not sound proper style.  Maybe "Child table has
FOO, parent table expects BAR."  Or maybe put it all in errmsg, 
  errmsg("child table \"%s\" has storage option \"%s\" for column \"%s\" mismatching \"%s\" on parent",

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Multivariate MCV list vs. statistics target
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Duplicated LSN in ReorderBuffer