From: | Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at> |
---|---|
To: | "'Horst Herb'" <hherb(at)malleenet(dot)net(dot)au> |
Cc: | "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | AW: AW: PLEASE help with foreign key and inheritance pr oble m |
Date: | 2000-12-13 14:05:34 |
Message-ID: | 11C1E6749A55D411A9670001FA68796336817C@sdexcsrv1.f000.d0188.sd.spardat.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>>
>> create unique index child_id_index on child (id);
>Thanks a lot. You saved my day :-)))
Always feels good to be able to help :-)
> > > CREATE TABLE will create implicit trigger(s) for FOREIGN
> KEY check(s)
> > > ERROR: UNIQUE constraint matching given keys for referenced
> > > table "child"
> > > not found
> >
> > Then the above works.
> > Actually the error message sounds sufficiently clear to me, no?
>
> I retrospect, yes. Still, I think inheritance could/should do that for me
> automatically. Is there a good reason why it doesn't ?
None, other that 1. noone implemented it and 2nd there was no generally
accepted plan on how this should work.
e.g. should the unique index for the serial span the whole hierarchy,
or should a separate index be created for each table ?
As a hint I would keep my fingers off inheritance as it stands now,
since all it is good for is to save you some typing for the create table
statements. It currently has almost no other functionality except to
give you the supertable columns for all rows in the hierarchy if you
select * from supertable.
Andreas
From | Date | Subject | |
---|---|---|---|
Next Message | Max Khon | 2000-12-13 14:10:18 | left join bug? (fwd) |
Previous Message | Jan Wieck | 2000-12-13 13:39:57 | Re: 7.0.3(nofsync) vs 7.1 |