X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 0C1AECC642 for ; Wed, 16 Jul 2003 15:43:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 16501-01 for ; Wed, 16 Jul 2003 15:44:06 +0000 (GMT) Received: from viefep16-int.chello.at (viefep16-int.chello.at [213.46.255.17]) by svr1.postgresql.org (Postfix) with ESMTP id 39030CC62E for ; Wed, 16 Jul 2003 12:43:38 -0300 (ADT) Received: from Makoto.student.tuwien.ac.at ([212.186.202.188]) by viefep16-int.chello.at (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with ESMTP id <20030716154404.VPNG4247.viefep16-int.chello.at@Makoto.student.tuwien.ac.at> for ; Wed, 16 Jul 2003 17:44:04 +0200 Message-Id: <5.2.0.9.0.20030716173925.00c69d10@pop.chello.at> X-Sender: e9625203@stud4.tuwien.ac.at X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Wed, 16 Jul 2003 17:44:16 +0200 To: pgsql-sql@postgresql.org From: Andreas Subject: "Truncate [ Table ] name [Cascade]"? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/280 X-Sequence-Number: 14394 Hi there, Would it be possible to implement some kind of cascading truncate? As far as I understand, the "no truncate if table is referenced" change was introduced to ensure database integrity. However, if the referencing table is truncated, too, there should be no problems as far as foreign keys are concerned, correct? Another option that seems feasible to me: How about allowing truncates on tables that are only referenced (if at all) by ones with no entries? Since no data is actually "enforcing" the foreign key restriction, truncating the table should be safe ... The rationale behind this suggestion is that we need a quick way to purge the entries in all tables in order to accelerate the reinitialization of the tables for our unit tests. If you know of some better way to truncate all tables, please let us know it. Thanks for your time, Andi.