Re: inheritance and table

Поиск
Список
Период
Сортировка
От arie nugraha
Тема Re: inheritance and table
Дата
Msg-id 44A0A0DF.6020908@gmail.com
обсуждение исходный текст
Ответ на inheritance and table  (nik600 <nik600@gmail.com>)
Список pgsql-general
Inheritance in postgre means you will have same fields definition
like the inherited table plus its own fields. So if table B is inherit
table A,
table B will have same field  definition  like A plus  table  B own
unique field(s).

It wont share primary keys, table B just have primary key in the same
field(s) like A
and records in table A wont be replaced by record(s) inserted to table B
or vice versa.

table A and table B basically a different entity, they just have same
fields definition.

Hope that will help you

> hi
>
> i don't have understand how works inheritance of tables...
>
> if table B inherits from table A
>
> - A and B must share primary keys?
>
> - if i isert record in B the record is replaced in A ?
>
> can i avoid this?
>
> 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!
>
> is it possible?
>
> thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org
>


В списке pgsql-general по дате отправления:

Предыдущее
От: Erik Jones
Дата:
Сообщение: Re: inheritance and table
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: auto-vacuum & Negative "anl" Values