From: | Mark Roberts <mailing_lists(at)pandapocket(dot)com> |
---|---|
To: | patricia-mitche(at)excite(dot)com |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Question: |
Date: | 2008-06-10 16:49:48 |
Message-ID: | 1213116588.9666.47.camel@localhost |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 do a query on the supertable, would the identical rows be displayed twice since the rows appear in the supertable and the subtable?
>
> 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!
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | JORGE MALDONADO | 2008-06-11 15:43:50 | DATABASE CLONNING |
Previous Message | Patricia Mitchell | 2008-06-10 14:18:05 | Question: |