Bug #566: Primary key not working correctly with inheritance

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #566: Primary key not working correctly with inheritance
Дата
Msg-id 200201231547.g0NFlZ669440@postgresql.org
обсуждение исходный текст
Ответы Re: Bug #566: Primary key not working correctly with inheritance  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Bug #566: Primary key not working correctly with  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-bugs
Adrian Bool (aid@logic.org.uk) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Primary key not working correctly with inheritance

Long Description
Hi,

Just started out with postgres (2 days so far!).  I am intrested in it's inheritance abilities.

I have come across something that seems to be a bug as far as I can make out.

See the simple extract in the example code section.

The second insert should not be allowed as it breaks the primary key's unqiueness.  However postgres allows it's
insertion.

If one tries to insert directly into 'parent' the problem does not come about - the second insertion is rejected
correctly.

The same applies with the 'unique' constraint - which I think should
also apply to child tables.

This is in Postgres 7.1.3 - standard RedHat 7.1 build.

Hope this is indeed a bug and I've not been wasting your time with my newness to postgres.

Regards,

aid



Sample Code
create table parent
  (
  id  integer primary key
  ) ;

create table child
  (
  name  varchar (30)
  ) inherits (parent) ;

insert into child values ( 1, 'Adrian' ) ;
insert into child values ( 1, 'John' ) ;


No file was uploaded with this report

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

Предыдущее
От: "Dong Meng"
Дата:
Сообщение: Create a rule for updating on a view
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #565: Primary key not working correctly with inheritance