Re: [GENERAL] problem with parent/child table and FKs

2011-04-27 Thread Karsten Hilbert
On Thu, Apr 21, 2011 at 07:15:38PM +0200, Alban Hertroys wrote: > > What is the suggested approach for this situation ? (there > > will be more tables like "icd10" holding other coding > > systems of fairly diverse nature but all of them sharing > > .code and .term: LOINC, ATC, ICPC-2, ICD-9, ...)

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Karsten Hilbert
On Thu, Apr 21, 2011 at 07:15:38PM +0200, Alban Hertroys wrote: > BTW, do you really need those artificial PK's? If not, you > may well be better off dropping them. That way (code, term) > could be your PK instead. I don't know enough about your > data to make more than a guess though, I just get

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Karsten Hilbert
On Thu, Apr 21, 2011 at 07:53:04AM -0700, Adrian Klaver wrote: > On Thursday, April 21, 2011 4:36:51 am Karsten Hilbert wrote: > > Does anyone have any suggestions regarding the below ? > > The only thing I can come up with is to eliminate the FK : > fk_code integer not null >ref

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Alban Hertroys
On 18 Apr 2011, at 15:53, Karsten Hilbert wrote: > What is the suggested approach for this situation ? (there > will be more tables like "icd10" holding other coding > systems of fairly diverse nature but all of them sharing > .code and .term: LOINC, ATC, ICPC-2, ICD-9, ...). I think your best be

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Adrian Klaver
On Thursday, April 21, 2011 4:36:51 am Karsten Hilbert wrote: > Does anyone have any suggestions regarding the below ? The only thing I can come up with is to eliminate the FK : fk_code integer not null references code_root(pk_code_root) on update restrict

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Karsten Hilbert
On Thu, Apr 21, 2011 at 01:36:51PM +0200, Karsten Hilbert wrote: > Does anyone have any suggestions regarding the below ? If you guys happen to think this could be a "please-do-my-class-assignment-for-me" question -- I'd be glad to read up on things if someone clues me in on the relevant keywords

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Karsten Hilbert
Does anyone have any suggestions regarding the below ? Thanks, Karsten On Mon, Apr 18, 2011 at 03:53:16PM +0200, Karsten Hilbert wrote: > Hello all, > > since (according to the docs) PostgreSQL does not propagate > INSERTs from child tables unto parent tables the below does > not work, unfortun

[GENERAL] problem with parent/child table and FKs

2011-04-18 Thread Karsten Hilbert
Hello all, since (according to the docs) PostgreSQL does not propagate INSERTs from child tables unto parent tables the below does not work, unfortunately. What is the suggested approach for this situation ? (there will be more tables like "icd10" holding other coding systems of fairly diverse na