FOREIGN KEY composite_type.its_field REFERENCES ....

From: Belka Lambda <lambda-belka(at)yandex(dot)ru>
To: pgsql-general(at)postgresql(dot)org
Subject: FOREIGN KEY composite_type.its_field REFERENCES ....
Date: 2010-02-23 16:05:14
Message-ID: 44921266941114@webmail48.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi everyone!

Is there a way to construct FOREIGN KEYs from parts of composite-typed field?

The code returns an error:
-----------------------------------------
create table aaa (
a_id integer primary key,
a_str varchar)
;
create type content_of_bbb (a_id integer, b_str varchar);

create table bbb (
b_id integer primary key,
bbb_content content_of_bbb,
foreign key (bbb_content.a_id) references aaa(a_id)
);
-----------------------------------------
, so I suspect it's impossible. Is it?

Belka

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben Chobot 2010-02-23 16:23:51 Re: tuning bgwriter in 8.4.2
Previous Message Tom Lane 2010-02-23 15:53:55 Re: Minor systax error but not able to resolve it...