"Truncate [ Table ] name [Cascade]"?

From: Andreas <e9625203(at)student(dot)tuwien(dot)ac(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: "Truncate [ Table ] name [Cascade]"?
Date: 2003-07-16 15:44:16
Message-ID: 5.2.0.9.0.20030716173925.00c69d10@pop.chello.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2003-07-16 16:41:06 Re: numerical sort on mixed alpha/numeric data
Previous Message Dani Oderbolz 2003-07-16 15:27:44 Re: Data Warehousing