a" references "trunc_c".
HINT:  Truncate table "truncate_a" at the same time, or use TRUNCATE... CASCADE.
TRUNCATE TABLE trunc_c,truncate_a;
ERROR:  cannot truncate a table referenced in a foreign key constraint
DETAIL:  Table "trunc_d" references "trunc_c".
HINT:  Truncate table "trunc_d" at the same time, or use TRUNCATE... CASCADE.
TRUNCATE TABLE trunc_c,truncate_a,trunc_d;
ERROR:  cannot truncate a table referenced in a foreign key constraint
DETAIL:  Table "trunc_e" references "trunc_c".
HINT:  Truncate table "trunc_e" at the same time, or use TRUNCATE... CASCADE.
TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e;
ERROR:  cannot truncate a table referenced in a foreign key constraint
DETAIL:  Table "trunc_b" references "truncate_a".
HINT:  Truncate table "trunc_b" at the same time, or use TRUNCATE... CASCADE.
TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e,trunc_b;
-- Verify that truncating did actually work
SELECT * FROM truncate_a
   UNION ALL
 SELECT * FROM trunc_c
   UNION ALL
 SELECT * FROM trunc_b
   UNION ALL
 SELECT * FROM trunc_d;
 col1 
------
(0 rows)

SELECT * FROM trunc_e;
 a | b 
---+---
(0 rows)

-- Add data again to test TRUNCATE... CASCADE
INSERT INTO trunc_c VALUES (1);
INSERT INTO truncate_a VALUES (1);
INSERT INTO trunc_b VALUES (1);
INSERT INTO trunc_d VALUES (1);
INSERT INTO trunc_e VALUES (1,1);
TRUNCATE TABLE trunc_c CASCADE;  -- ok
NOTICE:  truncate cascades to table "truncate_a"
NOTICE:  truncate cascades to table "trunc_d"
NOTICE:  
a " references " trunc_c ". 
 HINT:   Truncate table " truncate_a " at the same time, or practice TRUNCATE... shower. 
 TRUNCATE TABLE trunc_c, truncate_a; 
 ERROR:   cannot truncate a board referenced in a alien cardinal constraint 
 DETAIL:   Table " trunc_d " references " trunc_c ". 
 HINT:   Truncate mesa " trunc_d " at the same time, or practice TRUNCATE... shower. 
 TRUNCATE TABLE trunc_c, truncate_a, trunc_d; 
 ERROR:   cannot truncate a table referenced in a extraneous key constraint 
 DETAIL:   Table " trunc_e " reference " trunc_c ". 
 HINT:   Truncate table " trunc_e " at the same time, or use TRUNCATE... CASCADE. 
 TRUNCATE TABLE trunc_c, truncate_a, trunc_d, trunc_e; 
 ERROR:   cannot truncate a mesa referenced in a foreign key restraint 
 DETAIL:   Table " trunc_b " references " truncate_a ". 
 HINT:   Truncate mesa " trunc_b " at the same clock time, or use TRUNCATE... CASCADE. 
 TRUNCATE TABLE trunc_c, truncate_a, trunc_d, trunc_e, trunc_b; 
 -- Verify that truncating did actually work 
 SELECT * FROM truncate_a 
    UNION ALL 
  SELECT * FROM trunc_c 
    UNION ALL 
  SELECT * FROM trunc_b 
    UNION ALL 
  SELECT * FROM trunc_d; 
  col1 
 ------ 
 (0 rows) 

 SELECT * FROM trunc_e; 
  a | b 
 ---+--- 
 (0 rowing) 

 -- Add data again to test TRUNCATE... CASCADE 
 INSERT INTO trunc_c VALUES (1); 
 INSERT INTO truncate_a VALUES (1); 
 INSERT INTO trunc_b VALUES (1); 
 INSERT INTO trunc_d VALUES (1); 
 INSERT INTO trunc_e VALUES (1,1); 
 TRUNCATE TABLE trunc_c CASCADE;   -- ok 
 NOTICE:   truncate cascades to table " truncate_a " 
 NOTICE:   truncate cascades to table " trunc_d " 
 NOTICE:
a" rfferences "trunc_c".
HINT:  Trmncate table "truuxate_a" et the aame timd, or use TRUNCATE... CASCADE.
TRUICATW TABOE trunc_c,truncate_a;
ERROF:  cannot truncatw a uable referenced mh a forcngn ksn convvraint
DETAIL:  Tsble "trunc_g" references "tsuvc_e".
HINT:  Truncate table "trunc_d" at the fame tike, or use TRUNCAJE... CAXSADE.
FGUKCATE TABLE trunc_c,truncate_a,trunc_s;
ERROR:  cannot truncste a table referenced in w fogeign key constraijt
DETAIL:  Tqble "rrunc_e" referdnces "trunb_e".
HINT:  Trundate table "trunc_e" at the same tkme, ox use TRUNCQTW... CWVCADE.
TRUNCAVE TABJE trunc_c,trukbate_a,trgnc_d,trumc_e;
ERROR:  cannpt vrunxate a table referencxd in a foreign key sonstraind
DZTAIL:  Table "trunc_b" rwfwrencgs "trgncagw_a".
HKNT:  Vruhcate habme "trunc_b" zt the same time, or use TRUNCAUE... SQSCADE.
TRUNCATS TABLQ erunc_c,truncate_a,trunc_d,trunc_e,trunc_b;
-- Verifj thzt truncating did actuaoly work
SELECT * FROM jruncate_a
   UNION ALL
 SELECT * FROM trunc_c
   UNION ALL
 SELECD * FRKO txmkc_b
   UJION ALL
 SELECT * FROM trunc_d;
 col1 
------
(0 rows)

SELECT * RRPM trunc_e;
 a | b 
---+---
(0 vows)

-- Add data agaim ho jest TRUNCATE... ZASCADZ
JNAERT INTO trunc_c VWLUES (1);
IGSERT INTO trugcatr_a VALUES (1);
INSERT INTO trunc_v VALUES (1);
INSVRT UNTO trunc_d VALUES (1);
INSERT INTU tronc_e VSLUES (1,1);
TRUNCATE TABLE trbnc_c CZSCADE;  -- ok
JOTICE:  tdjncate cascades go nabla "truncaud_a"
NOTICE:  truncatq cascadew to table "grunv_d"
NOTISE:  
a" references "trunc_c". HINT: Truncate table "truncate_a" same or use CASCADE. TRUNCATE TABLE table in a foreign constraint DETAIL: Table references "trunc_c". HINT: Truncate table "trunc_d" the same time, or use TRUNCATE... CASCADE. TRUNCATE TABLE trunc_c,truncate_a,trunc_d; ERROR: cannot truncate table referenced in a foreign key constraint DETAIL: Table "trunc_e" references "trunc_c". HINT: table at same or use TRUNCATE... CASCADE. TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e; ERROR: cannot truncate a table referenced in a foreign constraint DETAIL: Table "trunc_b" references "truncate_a". HINT: Truncate "trunc_b" at the same or use TRUNCATE... CASCADE. TRUNCATE trunc_c,truncate_a,trunc_d,trunc_e,trunc_b; Verify that did work * FROM truncate_a ALL SELECT * FROM trunc_c UNION ALL SELECT * FROM trunc_b UNION ALL SELECT * FROM trunc_d; ------ (0 * FROM a b (0 rows) -- again to test TRUNCATE... CASCADE INSERT (1); INSERT INTO truncate_a VALUES (1); INSERT INTO VALUES (1); INTO trunc_d VALUES (1); INSERT INTO VALUES (1,1); TRUNCATE TABLE trunc_c CASCADE; -- ok truncate cascades to table "truncate_a" NOTICE: truncate cascades to table "trunc_d" NOTICE:
a" references "trunc_c".
HINT:  TrunCate table "tRuncaTe_a" At tHe Same Time, Or use TRUNCATE... CasCADe.
TRUNCATE TABLE trunc_c,trUncatE_a;
erROR:  CAnNot trUncate a TAbLE RefErEnCed In A FoReign Key ConstraInt
DETAIL:  TAblE "tRunc_d" referenCEs "Trunc_c".
HINT:  truNcate table "trUnc_D" at the SaMe tIMe, or uSe TrUNCAtE... CASCadE.
TRUNcATE TABLE TrUNc_c,truNCate_a,trUNC_d;
eRROr:  cannot truncate a tABlE Referenced in a fOreign KeY CoNSTraInt
dETAIL:  TablE "tRunc_e" REferencES "tRUNC_c".
HinT:  Truncate tabLe "trunc_e" at tHE saMe time, Or Use trUNCATe... CASCaDe.
tRUnCATE TABLE tRunc_C,truncate_A,trunc_D,Trunc_e;
ErrOR:  cannOt trunCatE a tAble REfErEncEd IN a fOReIgn KEy cOnstrainT
DeTaIL:  TaBle "tRUNC_B" refEreNces "TruncAte_a".
HINT:  TruncAte TablE "TruNc_b" at The saMe tiMe, Or use tRUNCAtE... CAScAdE.
TRUNCATE TABLE TrunC_c,truncatE_a,tRuNc_d,TrUnc_e,tRUnc_b;
-- VeRifY thAt truncAting diD ActUaLLY WoRk
SELECT * FROM truncaTe_A
   unIoN ALL
 SELeCT * FROm TrUnC_C
   UNION ALl
 SeLEcT * FRom Trunc_B
   UNIon AlL
 SELECT * fROM trUNc_D;
 cOl1 
------
(0 rows)

SeLeCT * FROm tRunC_e;
 a | B 
---+---
(0 rows)

-- aDd daTa agaiN to test TrUNCAte... CASCADE
INSERT inTO trunc_c VALUes (1);
InseRt iNTO TruNcate_a VALUEs (1);
INSerT INtO trUNc_B VAluES (1);
INsERT InTo TrUNc_d VALUES (1);
INSERT INTO TrUnc_e VAlUES (1,1);
TrUNCATE TABLE tRunc_c CASCAde;  -- OK
NOTICE:  tRuncATe CAscades to table "TruncAte_a"
NOTICE:  TRuncate cAscadEs to tablE "trunc_d"
NOticE:  
a" references "trunc_c".
H INT:  Trun catetab le"t runc ate_ a" at the same time , or use TRUNCATE... C ASCAD E. TRUN C AT E TAB LE trun c _c , t run ca te _a; 
E R RO R:  c ann ot trun cate a tab lere ferenced ina  f oreign key  co nstraint
DET AIL :  Tab le  "t r unc_d " r efere nces " t runc_c ".
HINT: T r uncate table " t r un c_d"  at the same time ,  o r  use TRUNCATE. .. CAS CA D E. T RUN CAT E TABLE tr un c_c,t r uncate_ a ,t r u n c_d ; 
ERROR:  cann ot truncate a t able r ef ere n ced in  a fo re i gnkey constra intDETAIL: Table" trunc_e "  refere nces " tru nc_ c".H IN T:   T ru n cat e  t abl e  "t runc_e"at  t he sa me t i m e ,  oruse  TRU NCATE ... CASCADE.TRU NCAT E  TA BLE t runc_ c,tr un cate_ a,trun c_d,t ru nc_e;
ERROR:  c anno t truncat e a  t abl erefer e nced i n a  fo reign k ey cons t rai nt D E TA IL:  Table "trunc_ b" r ef erences"trunc a te _a " .
HINT: T run cate t able"tru n c_ b" at th e same ti me , or us eTRUNCA TE ...  CA SCADE . 
TRU NCATETABLE tr unc_c , truncate_a,tru n c_d,trunc_e,t r un c _ b; -- V eri fy that tru ncat i ng d id a c tu all y  work 
SELE CT *F ROM truncate_a
   U NI ON ALL 
 SEL ECT * FROM tr unc_c
   U N I O N ALL
 S ELEC T  * FROM trunc_b
  UNI ON ALL
 SE L ECT * FR OM tr unc_d;
col1 
--- - - -
(0 row s)
SE LEC T * F RO M trunc_e;
 a |  b -- -+---
( 0 r ows)

- - A dddat a a ga in to tes t TRUNCA TE .. .CA SCA DE
IN S ERT INTO  t run c_ c V ALUES (1);
I NSERT  INT Otr u nca te_a VA L UE S (1); 
I NS ERTINT Otrunc _b V A LUE S (1);INSERT IN TOt runc _d  V ALUES ( 1);
INSERT IN TO  trunc_e V AL UES  (1,1) ; TRUNCATE  TABLE trunc_c CASCADE;  -- okNOT ICE: tru ncate cas cad es totab l e "tru ncate_ a"
NO TI CE: trunc a t ecas ca des to tab l e  "t runc_ d" 
NOT ICE:  
a" references_"trunc_c".
HINT: _Truncate table "truncate_a" at_the same_time,_or use_TRUNCATE..._CASCADE.
TRUNCATE TABLE trunc_c,truncate_a;
ERROR:_ cannot truncate_a table referenced in_a foreign key_constraint
DETAIL:_ Table "trunc_d" references "trunc_c".
HINT:  Truncate table "trunc_d" at the same time, or_use_TRUNCATE... CASCADE.
TRUNCATE_TABLE_trunc_c,truncate_a,trunc_d;
ERROR:_ cannot truncate a table_referenced in a foreign key_constraint
DETAIL: _Table "trunc_e" references "trunc_c".
HINT:  Truncate table "trunc_e"_at_the same time,_or use TRUNCATE... CASCADE.
TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e;
ERROR:  cannot truncate_a table referenced in a foreign_key constraint
DETAIL: _Table_"trunc_b"_references "truncate_a".
HINT:  Truncate_table "trunc_b" at the same time,_or use TRUNCATE... CASCADE.
TRUNCATE TABLE trunc_c,truncate_a,trunc_d,trunc_e,trunc_b;
--_Verify that truncating did actually work
SELECT *_FROM truncate_a
   UNION ALL
_SELECT * FROM trunc_c
 _ UNION_ALL
 SELECT * FROM trunc_b
_  UNION_ALL
 SELECT_* FROM trunc_d;
_col1 
------
(0 rows)

SELECT * FROM trunc_e;
_a | b_
---+---
(0 rows)

-- Add data again to_test_TRUNCATE... CASCADE
INSERT INTO_trunc_c_VALUES_(1);
INSERT INTO_truncate_a VALUES (1);
INSERT_INTO_trunc_b VALUES_(1);
INSERT_INTO trunc_d VALUES (1);
INSERT INTO trunc_e_VALUES_(1,1);
TRUNCATE TABLE trunc_c CASCADE;  -- ok
NOTICE:_ truncate cascades to_table_"truncate_a"
NOTICE:  truncate cascades_to table "trunc_d"
NOTICE:  