[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-bugs] <bug>: on deleting org unit

From: Karsten Hilbert
Subject: Re: [Gnumed-bugs] <bug>: on deleting org unit
Date: Thu, 21 Nov 2013 13:58:37 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hello Marc,

thanks for your report.

> user comment  : on deleting org unit

Judging from the log I'd assume you wanted to
clean up organizations and units while preparing
for the 1.4 upgrade.

> 2013-11-19 23:43:23  ERROR     gm.db 
> (/usr/share/gnumed/Gnumed/pycommon/ #1251): RW 
> query failed: [DELETE FROM dem.org_unit WHERE pk = 3]
> 2013-11-19 23:43:23  ERROR     gm.db 
> (/usr/share/gnumed/Gnumed/pycommon/ #1254): PG 
> error code: 23503
> 2013-11-19 23:43:23  ERROR     gm.db 
> (/usr/share/gnumed/Gnumed/pycommon/ #1256): PG 
> error message: ERROR:  update or delete on table "org_unit" violates foreign 
> key constraint "test_org_fk_org_unit_fkey" on table "test_org"

What happens here is that you attempt to delete a unit with pk = 3
but PostgreSQL won't let you because:

> DETAIL:  Key (pk)=(3) is still referenced from table "test_org".

that unit is referenced from the table test_org (in other words,
it is a lab and has got test types linked to it).

This is not a bug as such but rather a deficiency in GNUmed
to gracefully deal with this situation. I am rather reluctant
to improve this for 1.3 (but will for 1.4) since:

a) one can simply postpone deleting org units to 1.4
b) deleting org units in 1.4 requires code different from 1.3

GPG key ID E4071346 @
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

reply via email to

[Prev in Thread] Current Thread [Next in Thread]