Adding "on delete cascade" to all foreign key constraints

From: Peter Hanson <lists(at)pkhanson(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Adding "on delete cascade" to all foreign key constraints
Date: 2007-05-15 17:19:54
Message-ID: 200705151219.54324.lists@pkhanson.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I was wondering if there's a fast way I can add "on delete cascade" to all
foreign key constraints in my database? Maybe a quick update I can make
against the catalog possibly? Or is there a way I can query for all foreign
key constrains in the database and then I could write up a quick script to do
the updates for me.

Any help is appreciated, TIA,

Pete Hanson

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rodrigo De León 2007-05-15 22:32:26 Re: SQL Query Validate Records Multiple Tables - Help Needed
Previous Message Gary Stainburn 2007-05-15 14:09:40 Re: workday function