Wenjin Zheng <wenjin.zheng@lsbc.com> writes:
> Is there a way to specify primary key in the child table using columns
> from parent table? I am using 6.5.0.
It sounds like the PRIMARY KEY spec is getting processed before the
parent table reference is expanded. That's probably a bug, but it's
not going to get fixed in 6.5 ;-). What I'd suggest is not relying
on the PRIMARY KEY syntax, but just writing out the equivalent CREATE
UNIQUE INDEX command separately after you create the child table.
(Strictly speaking, PRIMARY KEY also implies NOT NULL on each column,
which might be hard to duplicate if you don't want the same columns
to be NOT NULL in the parent, but as long as you can set them that
way in the parent you don't need PRIMARY KEY.)
regards, tom lane