On 29 Jul 2002 18:27:40 MDT, the world broke into rejoicing as
Stephen Deasey <[EMAIL PROTECTED]>  said:
> Curt Sampson wrote:
>> I'm still waiting to find out just what advantage table inheritance
>> offers. I've asked a couple of times here, and nobody has even
>> started to come up with anything.

> Table inheritance offers data model extensibility.  New (derived) tables
> can be added to the system, and will work with existing code that
> operates on the base tables, without having to hack up all the code.

But it kind of begs the question of why you're creating the new table in
the first place.

The new table certainly _won't_ work with existing code, at least from
the perspective that the existing code doesn't _refer_ to that table.

The same is not true for views; if you create a new view on a table, the
existing code that refers to the table in either "raw" form or in other
views already exist will certainly continue to work.

> Inherited indexes etc. would be nice, but it's the inability to have
> referential integrity against a base table that picks up child table
> rows that makes the current implementation useles.

Views will certainly inherit indices, and continue to maintain
referential integrity against the "base" table.

> I would rather see it fixed than junked, and better yet extended.  It
> would be incredibly useful in real-world projects with complex data
> models like OpenACS.

Have they found views to be an unacceptable alternative?

I just don't see that there's _all_ that much about table inheritance
that is really fundamentally wonderful.

The "incredibly useful" thing, it seems to me, would be to provide tools
that make it less necessary to create additional tables.  To be sure,
views do that.

I'm not quite sure what INHERITS buys us that we don't get from
  SELECT * into new_table from old_table

INHERITS may automagically draw in some contraints that have been
specifically tied to old_table that wouldn't be drawn by "SELECT * INTO
NEW_TABLE"; the latter _will_ inherit anything that is tied to the
types.

I'd _much_ rather have five views on one table than five tables.
--
(reverse (concatenate 'string "gro.gultn@" "enworbbc"))
http://cbbrowne.com/info/spreadsheets.html
"Everything should  be made as  simple as possible, but  not simpler."
-- Albert Einstein

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to