Re: ADD/DROPS inherits - Mailing list pgsql-patches

From Greg Stark
Subject Re: ADD/DROPS inherits
Date
Msg-id 873be8ej5o.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: ADD/DROPS inherits  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-patches
Simon Riggs <simon@2ndquadrant.com> writes:

> On Mon, 2006-06-12 at 17:39 -0400, Greg Stark wrote:
>
> > Points I'm uncertain about:
> >
> > . I throw an elog() error if there's a null conbin for a CHECK constraint. Is
> >   it possible for a valid CHECK constraint structure to have a null conbin?
>
> ruleutils shows: elog(ERROR, "null conbin for constraint %u"

I'm unclear what you mean by this. This doesn't look like what I would expect
the error to look like if it was triggered. And the "%u" makes it appear as if
the name of the constraint it "%u" which is passing strange too.

How do I reproduce this?

> > I added some basic (very basic) regression tests
>
> Should we fail if columns in the wrong order from the parent? I thought
> that was one of the restrictions you discovered?

I don't think we can complain about wrongly ordered columns. Tom pointed out
something as simple as adding more columns to the parent can create a
non-standard ordering since it adds them after the local columns. And in any
case verifying the order in complicated cases involving multiple parents and
locally defined columns would be nigh impossible anyways.

> Can we test for
>     ALTER TABLE child NO INHERIT parent1 INHERIT parent2
> That was on Hannu's wish list.
>
> Is INHERIT allowed or disallowed with other ALTER TABLE options?
> If it is allowed, can we test for something that will fail and something
> that would pass, e.g. ALTER TABLE DROP column1 INHERITS parent -- where
> the parent passes on column1.

Both those two cases both work, so you just want more regression tests?
No problem.

Note that operations aren't done in a strictly left-to-right order. For
instance ADD/DROP columns are done before INHERIT/NO INHERIT.

And "ALTER TABLE child NO INHERIT parent 1, INHERIT parent2" will treat
attislocal subtly different from the reverse.


> When I read those tests, it makes me think this should be INHERITS and
> NOT INHERITS (not great English, but then neither is NO INHERIT).
> ISTM it might become confusing between INHERITS and INHERIT.
> Waddyathink?

None of these syntaxes are particularly more or less appealing than any other
to me. I'm still trying to think of something better.

--
greg

pgsql-patches by date:

Previous
From: Greg Stark
Date:
Subject: ADD/DROPS INHERIT (actually INHERIT / NO INHERIT)
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Fix Ctrl-C related issues in psql (not for 8.1)