Greg Stark <[EMAIL PROTECTED]> 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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to