Re: Attached partition not considering altered column properties ofroot partition. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Attached partition not considering altered column properties ofroot partition.
Date
Msg-id 20190726221656.GA17989@alvherre.pgsql
Whole thread Raw
In response to Re: Attached partition not considering altered column properties ofroot partition.  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: Attached partition not considering altered column properties ofroot partition.  (Amit Langote <amitlangote09@gmail.com>)
List 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 by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Multivariate MCV list vs. statistics target
Next
From: Alvaro Herrera
Date:
Subject: Re: Duplicated LSN in ReorderBuffer