Cascading deletes in PostgreSQL

前端 未结 7 851
醉梦人生
醉梦人生 2021-01-03 01:59

I have a database with a few dozen tables interlinked with foreign keys. Under normal circumstances, I want the default ON DELETE RESTRICT behavior for those co

7条回答
  •  北荒
    北荒 (楼主)
    2021-01-03 02:17

    TRUNCATE table CASCADE;
    

    I'm a Postgres novice, so I'm not sure what the trade-off is for TRUNCATE vs. DROP.

提交回复
热议问题