Re: Inheritance fixing timeline? (Was "Inherited FK Indexing")

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: Webb Sprague <webb(dot)sprague(at)gmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance fixing timeline? (Was "Inherited FK Indexing")
Date: 2007-10-01 13:41:40
Message-ID: C3265534.8178F%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Is this set to be fixed in any particular release?

Depending on what you're doing, this may be overkill, but: I have child
tables that not only need FK constraints, but also triggers and the
functions called by the triggers. So instead of writing this over and over
again, I eventually wrote a single procedure that takes the name of the
table, and using dynamic sql (execute command), generates the FKs and the
procedures and the triggers.

You *could* take it a step further, and have a procedure which takes the
name of the base table, finds all inherited tables, and makes sure
everything is set up correctly. I haven't, and probably won't, because I'm a
solo developer and don't make additions to the schema at such a great rate
that I would have trouble remembering to run my current "FooChild_Setup"
function on a new table.

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 722-0567 voice

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Poul Møller Hansen 2007-10-01 13:51:04 Dump of table structure is not consistent
Previous Message Alban Hertroys 2007-10-01 12:58:08 Re: more problems with count(*) on large table