Search Postgresql Archives

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

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

 



> 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@xxxxxxxxxxxxxxx
http://www.killerbytes.com/
(303) 722-0567 voice



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux