Foreign keys: unexpected result from ALTER TABLE... ADD CONSTRAINT...

Поиск
Список
Период
Сортировка
Искать
От
Oliver Elphick
Тема
Foreign keys: unexpected result from ALTER TABLE... ADD CONSTRAINT...
Дата
Msg-id
200001171243.MAA12727@linda.lfix.co.uk
Список
Дерево обсуждения
Re: [HACKERS] Foreign keys: unexpected result from ALTER TABLE... ADD CONSTRAINT... Hannu Krosing <hannu@tm.ee>
I cannot do this pair of table creations directly, because they are mutually
dependent.


create table purchased_job
(supplier	char(10)	not null			        references supplier (id) match full,specification	text,del_point	char(2)		not null			        references location (id) match full,import_licence	bool		default 'f',import_duty	numeric(12,2),terms		char(3),deliv_clear	numeric(12,2),
foreign key (product, supplier) references product_supplier (product, 
supplier) match full
)inherits (job)
;



create table product_supplier
(product		char(10)		not null			        references purchased_job (product) match full,supplier	char(10)	not null			        references supplier (id) match full,
primary key (product, supplier)
)
;

so I omitted the foreign key specification from the creation of purchased_job
and tried to add it afterwards, but (after fixing a bug in gram.y) I found
that ALTER TABLE ... ADD CONSTRAINT is not yet implemented.  Is there, then, any
way to create this mutual dependency?

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver              PGP key from public servers; key ID 32B8FAA1                ========================================    "And, behold, I come quickly; and my reward is with me,     to give every man according as his work shall be."                                  Revelation 22:12 



В списке pgsql-hackers по дате отправления
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] TODO list
От: Peter Eisentraut
Дата:
FAQ