Re: Truncate on tables with FK's - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Truncate on tables with FK's
Date
Msg-id 19423.1121746574@sss.pgh.pa.us
Whole thread Raw
In response to Truncate on tables with FK's  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> Hmmm...could we allow truncate in cases where all the FK's on a table 
> refer only to that table itself?

Alvaro already did that and more ...

2005-01-26 22:17  tgl
* doc/src/sgml/ref/truncate.sgml, src/backend/catalog/heap.c,src/backend/commands/tablecmds.c,
src/backend/nodes/copyfuncs.c,src/backend/nodes/equalfuncs.c,src/backend/parser/gram.y,src/backend/tcop/utility.c,
src/include/catalog/heap.h,src/include/commands/tablecmds.h,
src/include/nodes/parsenodes.h,src/test/regress/expected/temp.out,src/test/regress/expected/truncate.out,src/test/regress/sql/temp.sql,
src/test/regress/sql/truncate.sql:GeneralizeTRUNCATE to support truncating multiple tables in onecommand.  This is
usefulbecause we can allow truncation of tablesreferenced by foreign keys, so long as the referencing table istruncated
inthe same command.Alvaro Herrera
 

        regards, tom lane


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Truncate on tables with FK's
Next
From: Patrick Welche
Date:
Subject: Re: escape string syntax and pg_dumpall