foreign key constraints with inhertiance, hack suggestions?

From: George Nychis <gnychis(at)cmu(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: foreign key constraints with inhertiance, hack suggestions?
Date: 2007-03-22 01:29:44
Message-ID: 4601DC08.9010108@cmu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

First, yes I have read the "5.8.1. Caveats" section that this support does not exist.

I agree with the document that this is "a serious limitation of the inheritance feature"

Has there been any effort to support this in the near future versions of postgresql? I
searched the mailing lists and didn't quite find a straight answer on that, only that
there will be some sort of stronger inheritance in 8.2

Second, I was wondering if anyone has any hack suggestions at doing some integrity checks?

Basically I have a master 'flows' table which is partitioned and has non-overlapping CHECK
constraints on each partition. Each record in the partitions have a unique pair of
attributes: interval, flow_id

When inserting in to another table 'flow_labels', these two attributes are given, I want
to ensure that there exists a single flow in some partition in the 'flows' table that has
these two values.

I'm no DB expert, but could there be some sort of rule or trigger on insert into
'flow_labels' that does a count() where these two values are exact to ensure there exists
1 flow? Problem is my 'flows' table is on the order of billions of flows, each partition
having hundreds of thousands.

Suggestions?

Thanks!
George

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Pool 2007-03-22 02:39:31 libpq dependencies
Previous Message Dhaval Shah 2007-03-22 00:58:14 Re: Postgres Hot Standby. How or when does the recovery db move recovery.conf to recovery.done?