Re: Truncate on tables with FK's

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Truncate on tables with FK's
Date: 2005-07-19 04:16:14
Message-ID: 19423.1121746574@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)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:
Generalize TRUNCATE to support truncating multiple tables in one
command. This is useful because we can allow truncation of tables
referenced by foreign keys, so long as the referencing table is
truncated in the same command.

Alvaro Herrera

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-07-19 07:32:09 Patch to fix plpython on OS X
Previous Message Christopher Kings-Lynne 2005-07-19 04:09:21 Truncate on tables with FK's