Partitioned Tables Foreign Key Constraints Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Have a problem related to partition tables.

We have the following schema's :

master -
id integer (PRIMARY KEY)
cid integer

child1, child2 are the child tables of master table. Here "cid" is the field used for partitioning.

We have another table called
other_tbl -
id integer (PRIMARY KEY)
m_id integer (FOREIGN KEY FROM master(id))

Now the problem is, since other_tbl->m_id referenced from master->id, if we try to insert any vales in "other_tbl" for m_id its checks it presence in only master table and not in its child table. As the master table is always empty in partitions tables a foreign key violation ERROR is being given.

How can we define the Foreign_key constraint on "other_tbl" based upon any partitioned table field.

--
Regards
Gauri

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux