Question on Inheritance and Primary Keys.

Поиск
Список
Период
Сортировка
От Dutt Kalapatapu
Тема Question on Inheritance and Primary Keys.
Дата
Msg-id 3.0.6.32.19991011122638.009aa3e0@pop.eudoramail.com
обсуждение исходный текст
Ответы Re: [SQL] Question on Inheritance and Primary Keys.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
I have two Tables:

TableA(
parameterone int,
parametertwo int,
PRIMARYKEY(parameterone),
UNIQUE(parameterone)
);

TableB(
parameterthree int
)INHERITS(TableA);


I expect from this that when we insert some thing in TableB then
parameterone should be unique, but the database is not enforcing the rule
and it takes duplicate values.  But when I insert two duplicate keys in
TableA then it complains.  This means that Inheritance removes the
primarykey etc from the inherited table??? I couldn't think why this object
oriented behaviour doesn't work here.


Can some one explain this behaviour.

Thanks
Dutt

--Dutt Kalapatapu   ________________________  |ipVerse Inc.,           |  |1901 Landings Drive     |  |Mountain View,
CA-94043|  |Telefono: 650 919 0647  |  |________________________|
 


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [SQL] DELETE/DROP and inheritance
Следующее
От: "Saltsgaver, Scott"
Дата:
Сообщение: Reporting errors when a rule fails.