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

Lists: pgsql-general
From: "Webb Sprague" <webb(dot)sprague(at)gmail(dot)com>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Inheritance fixing timeline? (Was "Inherited FK Indexing")
Date: 2007-09-30 23:28:43
Message-ID: b11ea23c0709301628g186316aaw6797dcfa47abda79@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

> > Is it
> > possible to have FK that spans into child tables?
>
> This is a well known (and documented, see [1]) deficiency. It's due to
> the current implementation of indices, which are bound to exactly one
> table, meaning they do return a position within the table, but cannot
> point to different tables.

Is this set to be fixed in any particular release?

(Here's hoping that someone smarter than I am is working on it...)

-W


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
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


From: Alvaro Herrera <alvherre(at)commandprompt(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 16:33:35
Message-ID: 20071001163335.GA5914@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Webb Sprague escribió:
> > > Is it
> > > possible to have FK that spans into child tables?
> >
> > This is a well known (and documented, see [1]) deficiency. It's due to
> > the current implementation of indices, which are bound to exactly one
> > table, meaning they do return a position within the table, but cannot
> > point to different tables.
>
> Is this set to be fixed in any particular release?

No, sorry.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support