I have a big table A (~30 million lines) at the core of my model. Another table B has a foreign key referencing A. I would like to partition A using the well-known inheritance hack.
Is there a manageable way to have a foreign key constraint in table B so that every line in B is constrained to reference an existing line in A? (You know, a foreign key constraint.)
I am actually considering dropping this constraint as I see no other solution. Is there?
edit
I believe I can have a foreign key constraint from B to A but it is useless since when inserting into A, the line would go into a sub-table instead and would never be found by the constraint. Is it correct?