Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Re: Question:
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 3135 of 3255
Post > Topic >>

Re: Question:

by mailing_lists@[EMAIL PROTECTED] (Mark Roberts) Jun 10, 2008 at 09:49 AM

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 ****tal on the Web!
> 
> 
> 


-- 
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
 




 2 Posts in Topic:
Question:
patricia-mitche@[EMAIL PR  2008-06-10 10:18:05 
Re: Question:
mailing_lists@[EMAIL PROT  2008-06-10 09:49:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 9:42:56 CDT 2008.