[Postgres-xl-developers] Inheritance and alter_table test case

Tomas Vondra tomas.vondra at 2ndquadrant.com
Mon Aug 7 05:14:05 PDT 2017


Hi,

On 08/07/2017 01:22 PM, Pavan Deolasee wrote:
> 
> 
...
> 
>     The one aspect of the patch I'm uncomfortable with is that we do the
>     distribution check before the regular PostgreSQL checks, and as we
>     error out those checks are ineffective.
> 
>     For example, the patch does this:
> 
>       alter table atacc3 inherit atacc2;
>     -ERROR:  child table is missing constraint "foo"
>     +ERROR:  table "atacc3" contains column "test2" at position 2, but
>     parent "atacc2" has it at position 1
>     +DETAIL:  Postgres-XL requires attribute positions to match
>     +HINT:  Check for column ordering and dropped columns, if any
> 
>     So how will we know we haven't broken the constraint check? Are
>     there some other tests for this (I don't think so)?
> 
> 
> Fair point.
> 
>     I think we need to either move the distribution check to a later
>     stage (to still enforce the PostgreSQL constraints first), and then
>     maybe add a few regression tests enforcing the "same distribution"
>     restriction. Or do something else that would keep both the old and
>     new checks.
> 
> 
> Wouldn't adding tests that pass the distribution check and then exercise 
> the constraint check be enough?
> 

Yes, that would work too. But it would mean more significant difference 
compared to upstream. Moving the distribution check after the "simple" 
PostgreSQL checks would allow us to keep the expected output closer to 
upstream, which I believe is a good thing. But maybe that's not possible 
or convenient for some reasons.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


More information about the Postgres-xl-developers mailing list