postgresql: there is no unique constraint matching given keys for referenced table
After some clarification (in comments and chat), it seems that:


ChildA and ChildB are subtypes.
a VIPUser has a many-to-many relationship with all Child entities ("VIPUser "uses" Child").
there is a many-to-many relationship between VIPUser and ChildType (stored in Parent), essentially what types of Child a `VIPuser can use ("VIPUser "can use" a child of ChildType").


Then the relationships between entities can be shown in the diagram
(I renamed Parent to VIPCanUse):

               ChildType
VIPUser        /      \
      \       /        \
       \     /          \
      VIPCanUse          \
           \           Child
            \         /    |
             \       /     ------------
              \     /        |        | 
               \   /       ChildA   ChildB
              VipUses