gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] use of SQL command TRUNCATE


From: Ian Haywood
Subject: Re: [Gnumed-devel] use of SQL command TRUNCATE
Date: Mon, 27 Oct 2003 13:19:01 +1100

On Mon, 27 Oct 2003 11:37:19 +1100
Horst Herb <address@hidden> wrote:


> If truncate doesn't work because of foreign key violation, delete won't 
> either 
> - unles youspecify a "cascade", in which case all referencing table rows will 
> be deleted as well, which is probably not what you want.
> 
> Horst
My understanding from the docs is that truncate deletes without scanning,
so it has no way of known whether or not foreign keys are being violated,
so on 7.3 it doesn't even try.
whereas delete will check, and works if there are no foreign key violations

"cascade" probably is what we want in this context: these the setup scripts 
making
sure tables are empty before they are filled.

Ian
-- 
PGP public key E750652E at wwwkeys.pgp.net
9BF0 67B7 F84F F7EE 0C42  C063 28FC BC52 E750 652E




reply via email to

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