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: Horst Herb
Subject: Re: [Gnumed-devel] use of SQL command TRUNCATE
Date: Mon, 27 Oct 2003 11:37:19 +1100
User-agent: KMail/1.5.9

On Sun, 26 Oct 2003 20:42, Karsten Hilbert wrote:
> > Truncate doesn't appear to be allowed on tables that are referenced by
> > another table. I am using Postgresql 7.3.3
>
> Works on the older 7.1.x
>
> > Why do we need it?
>
> To clean out some tables before inserting data but an
> unconditional delete will do, too, albeit slower.

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




reply via email to

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