pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas <e9625203@student.tuwien.ac.at>
To: pgsql-sql@postgresql.org
Subject: "Truncate [ Table ] name [Cascade]"?
Date: Wed, 16 Jul 2003 17:44:16 +0200
Message-ID: <5.2.0.9.0.20030716173925.00c69d10@pop.chello.at> (raw)

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.





view thread (2+ messages)  latest in thread

Message-ID: <5.2.0.9.0.20030716173925.00c69d10@pop.chello.at>
Permalink:  ../5.2.0.9.0.20030716173925.00c69d10@pop.chello.at/
Also on:    postgresql.org/message-id/5.2.0.9.0.20030716173925.00c69d10@pop.chello.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: e9625203@student.tuwien.ac.at
  Subject: Re: "Truncate [ Table ] name [Cascade]"?
  In-Reply-To: <5.2.0.9.0.20030716173925.00c69d10@pop.chello.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox