Re: Inheritance in Postgresql ? - Mailing list pgsql-admin

From Scott Marlowe
Subject Re: Inheritance in Postgresql ?
Date
Msg-id dcc563d10912152251y22f53966m5aca84d734697945@mail.gmail.com
Whole thread Raw
In response to Inheritance in Postgresql ?  (ABBAS SHAKEEL <shakeel.abbas.qau@gmail.com>)
Responses Re: Inheritance in Postgresql ?  (ABBAS SHAKEEL <shakeel.abbas.qau@gmail.com>)
List pgsql-admin
On Tue, Dec 15, 2009 at 11:36 PM, ABBAS SHAKEEL
<shakeel.abbas.qau@gmail.com> wrote:
> Hello
> I am not an expert for database but rarely design database for Web and IVR
> applications.
> Today I wonder if there is any practical advantage of inheritance of Tables.
> Lets take the same example that is commonly referred.
>
> CREATE TABLE cities (
>     name            text,
>     population      float,
>     altitude        int     -- in feet
> );
>
> CREATE TABLE capitals (
>     state           char(2)
> ) INHERITS (cities);
>
> Capital table inherit attributes from Cities but no data. I am confused with
> concept of inheritance in postgres.
>
> In These tables what i was supposing is inheritence as that in JAVA. but its
> seems to be  a different scene.

The child table inherits structure from the parent, the parent then
allows you to retrieve data from it and the children together.

pgsql-admin by date:

Previous
From: ABBAS SHAKEEL
Date:
Subject: Inheritance in Postgresql ?
Next
From: ABBAS SHAKEEL
Date:
Subject: Re: Inheritance in Postgresql ?