> i don't have understand how works inheritance of tables...
> if table B inherits from table A
> - A and B must share primary keys?
No, currently there is no unique constraint that will force uniqueness across parent/child/sibling
tables. Just think of them as being nothing more than seperate table that share simlar
data-definitions.
When you select * from parent; you are essentially preforming a:
select * from parent
union
select * from childa
union
select * from childb ....;
if you want to only see the records in A then select * from only parent;
> - if i isert record in B the record is replaced in A ?
>
> can i avoid this?
This will not happen, you will end up with two records one A and one in B.
> i would like to have this scenario:
>
> table A
>
> table B inheridts from A
> table C inheridts from A
>
> if i insert a record in B it must be insered only in B!
> if i insert a record in C it must be insered only in C!
This is how is it will work.
http://www.postgresql.org/docs/8.1/interactive/ddl-inherit.html
Notice 5.8.1. Caveats
Regards,
Richard Broersma Jr.