BUG #1055: no keys in inherited table with primary key when inserting into inheriting table

Поиск
Список
Период
Сортировка
Искать

BUG #1055: no keys in inherited table with primary key when inserting into inheriting table

От:
"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>
Дата:
The following bug has been logged online:

Bug reference:      1055
Logged by:          Agri

Email address:      agri@desnol.ru

PostgreSQL version: 7.4

Operating system:   PC-linux-gnu

Description:        no keys in inherited table with primary key when 
inserting into inheriting table 

Details: 

let me desribe a bug in the term of sql commands:
create table first (id int primary key );
create table second (f2 int) inherits (first);
create table third (ref_id int);
alter table third add constraint third_ref_first foreign key (ref_id) 
references first; 
insert into second (id, f2) values (1, 1);

and at last a bug insert:
insert into third (ref_id) values (1);
results in:
ERROR:  insert or update on table "third" violates foreign key constraint 
"third_ref_first" 

if i get a select:
select * from first;
 id 
----
  1
(1 row)

bug is: values are not added into primary key of the inherited table when 
records are inserted into the inheriting table
FAQ