Re: ADD/DROP INHERITS - Mailing list pgsql-patches

From Tom Lane
Subject Re: ADD/DROP INHERITS
Date
Msg-id 924.1149958838@sss.pgh.pa.us
Whole thread Raw
In response to Re: ADD/DROP INHERITS  (Greg Stark <gsstark@mit.edu>)
Responses Re: ADD/DROP INHERITS  (Greg Stark <gsstark@mit.edu>)
Re: ADD/DROP INHERITS  (Greg Stark <gsstark@mit.edu>)
Re: ADD/DROP INHERITS  (Greg Stark <gsstark@mit.edu>)
List pgsql-patches
Greg Stark <gsstark@mit.edu> writes:
> So should I set up a nested scan, essentially implementing a nested loop? or
> should I gather together all the children in a list?

I'd use the predigested form of the constraints attached to the Relation
tupledescs, cf. RelationBuildTupleDesc, equalTupleDescs.  It might be
worth refactoring equalTupleDescs so you could share code --- ISTM what
you're trying to implement is something like a "subsetTupleDesc".

> And are there any other fields of pg_constraint that I should be checking for
> matches in? Do we care if a parent table has a non-deferrable constraint and
> the child has a deferrable one, or if the parent's is deferred by default and
> the child isn't?

I don't believe those attributes mean anything for check constraints
ATM, but you may as well compare them anyway.  If we ever do implement
them then it'd be reasonable to expect parent and child to have
identical settings.

> Also, it seems to me that LIKE ought to copy constraints or at least have an
> option to.

What does the spec say about that?

            regards, tom lane

pgsql-patches by date:

Previous
From: Greg Stark
Date:
Subject: Re: ADD/DROP INHERITS
Next
From: Greg Stark
Date:
Subject: Re: ADD/DROP INHERITS