Hi,
I want to reference an inherited table:
- - - Schnipp - - -
create table parent
(
id serial,
primary key(id)
);
create table child
(
thing integer
) inherits (parent);
create table third
(
stuff integer references child
);
- - - Schnapp - - -
But get an error:
ERROR: PRIMARY KEY for referenced table "child" not found
Is there a way to do it or do I have to reference parent?
tia,
Thorsten
--
Auch Hunger ist Krieg.
- Willy Brandt
Hi,
>create table third
>(
> stuff integer references child
>);
>- - - Schnapp - - -
>But get an error:
>ERROR: PRIMARY KEY for referenced table "child" not found
Try
create table third(
stuff integer references child(thing)
);
You could do what you were trying to do if in the child table you have a
field called 'stuff', but since you don't, you have to reference it
specifically.
-----------------
Chris Smith
http://www.squiz.net/
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера