Unix Technical Forum

Inheritance

This is a discussion on Inheritance within the pgsql Novice forums, part of the PostgreSQL category; --> Hi, I'm just wondering, what real benefit does inheritance have? When i create two tables, one inherited from the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 08:16 PM
Hasnul Fadhly bin Hasan
 
Posts: n/a
Default Inheritance

Hi,

I'm just wondering, what real benefit does inheritance have? When i
create two tables, one inherited from the other,
does that mean i have two tables with same duplicate data or actually
they are joined in the back end?


Thank you for any input regarding this matter.

Hasnul




---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 08:16 PM
Tom Lane
 
Posts: n/a
Default Re: Inheritance

Hasnul Fadhly bin Hasan <hasnulfadhly.h@mimos.my> writes:
> I'm just wondering, what real benefit does inheritance have? When i
> create two tables, one inherited from the other,
> does that mean i have two tables with same duplicate data or actually
> they are joined in the back end?


It's more like an implicit UNION ALL. There's no duplication, but when
you specify a SELECT/UPDATE/DELETE over the parent table, the child
table is implicitly processed as well.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 08:16 PM
Tjibbe Rijpma
 
Posts: n/a
Default Re: Inheritance

When will the function inheritence be futher development? That Primary keys
work wil on both parent and child table.

Now a use one table and several table with the same foreign keys to that
table. And a function have to do two insert of update actions.

----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Hasnul Fadhly bin Hasan" <hasnulfadhly.h@mimos.my>
Cc: <pgsql-novice@postgresql.org>
Sent: Tuesday, December 21, 2004 4:45
Subject: Re: [NOVICE] Inheritance


> Hasnul Fadhly bin Hasan <hasnulfadhly.h@mimos.my> writes:
> > I'm just wondering, what real benefit does inheritance have? When i
> > create two tables, one inherited from the other,
> > does that mean i have two tables with same duplicate data or actually
> > they are joined in the back end?

>
> It's more like an implicit UNION ALL. There's no duplication, but when
> you specify a SELECT/UPDATE/DELETE over the parent table, the child
> table is implicitly processed as well.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>



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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 08:17 PM
Bruno Wolff III
 
Posts: n/a
Default Re: Inheritance

On Tue, Dec 21, 2004 at 09:27:05 +0100,
Tjibbe Rijpma <t.b.rijpma@student.tudelft.nl> wrote:
> When will the function inheritence be futher development? That Primary keys
> work wil on both parent and child table.


When someone does the work. This has been an open issue for a long time
and it doesn't seem to be a high priority for anyone.

> Now a use one table and several table with the same foreign keys to that
> table. And a function have to do two insert of update actions.


One reason that it probably isn't a high priority is you can do a lot of
the same stuff using views instead of inheritence.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:19 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com