pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
"Truncate [ Table ] name [Cascade]"?
2+ messages / 2 participants
[nested] [flat]

* "Truncate [ Table ] name [Cascade]"?
@ 2003-07-16 15:44 Andreas <e9625203@student.tuwien.ac.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Andreas @ 2003-07-16 15:44 UTC (permalink / raw)
  To: 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.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: "Truncate [ Table ] name [Cascade]"?
@ 2003-07-21 09:30 Wolfgang Slany <wsi@dbai.tuwien.ac.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Wolfgang Slany @ 2003-07-21 09:30 UTC (permalink / raw)
  To: pgsql-sql; +Cc: Andreas <e9625203@student.tuwien.ac.at>

Even better for quickly reinitialising all tables for unit-tests might be
a command that does a "TRUNCATE ALL".

JM2Cs, Wolfgang



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-07-21 09:30 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-16 15:44 "Truncate [ Table ] name [Cascade]"? Andreas <e9625203@student.tuwien.ac.at>
2003-07-21 09:30 Re: "Truncate [ Table ] name [Cascade]"? Wolfgang Slany <wsi@dbai.tuwien.ac.at>

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