Cedar Cox writes:
> CREATE TABLE obj_weights (
> object_id int4 REFERENCES ( apple_objects(id) OR banana_objects(id) )
> weight float4,
> )
The way I would work this out is like this:
CREATE TABLE fruit_objects ( object_id serial PRIMARY KEY, fruit_type text CHECK (fruit_type IN ('apple', 'banana')),
weightfloat4, ... other common fruit properties ...
);
CREATE TABLE apple_objects ( object_id integer REFERENCES fruit_objects, color text, ... more apple properties ...
);
CREATE TABLE banana_objects ( object_id integer REFERENCES fruit_objects, curvature real, ... other banana properties
...
);
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter