Re: Question: - Mailing list pgsql-novice

From Mark Roberts
Subject Re: Question:
Date
Msg-id 1213116588.9666.47.camel@localhost
Whole thread Raw
In response to Question:  ("Patricia Mitchell" <patricia-mitche@excite.com>)
List pgsql-novice
You inherit the data as well, for example:

Parent Table:
[ 'column', ],
[ 1,        ],
[ 2,        ],

Child Table:
[ 'column', ],
[ 3,        ],
[ 4,        ],

select * from parent_table;
[ 'column', ],
[ 1,        ],
[ 2,        ],
[ 3,        ],
[ 4,        ],


For a more concrete example:

create table parent (
    col integer
);

create table child () inherits (parent);

insert into parent values (1);
insert into parent values (2);
insert into child values (1);
insert into child values (2);
insert into child values (3);
insert into child values (4);

select 'Selecting from parent';
select * from parent;

select 'Selecting from child';
select * from child;

Best of luck!

-Mark


On Tue, 2008-06-10 at 10:18 -0400, Patricia Mitchell wrote:
>
> When a table is a supertable of other tables and a subtable consists of identical rows of the supertable and then you
doa query on the supertable, would the identical rows be displayed twice since the rows appear in the supertable and
thesubtable? 
>
> When you inherit a table, are you inheriting the table definition/structure or are you inheriting the data as well?
>
> If the answer is only the table structure, then please ignore the question above?
>
> Thanks.
>
>
>
>
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
>
>
>


pgsql-novice by date:

Previous
From: "Patricia Mitchell"
Date:
Subject: Question:
Next
From: "JORGE MALDONADO"
Date:
Subject: DATABASE CLONNING