Re: Deleting foreign key constraints

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Nikhil G(dot) Daddikar" <ngd(at)celoxis(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Deleting foreign key constraints
Date: 2002-08-29 13:57:09
Message-ID: 20020829065343.Q96596-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 29 Aug 2002, Nikhil G. Daddikar wrote:

> Is there a way to delete all foreign key constraints for a table?

Not a particularly good one. You'll probably need to drop the triggers
manually (from both that table and the table it references) and you'll
need to match up the arguments to do that. There's some info on
techdocs.postgresql.org about the triggers that you might find useful.

> Also, is there a way to programmatically find all tables (excluding
> system created) in a database?

Check the query generated by psql for a \d (use psql -E to get the
the query). It'll be something with pg_class.

>
> I am using 7.1.3

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-08-29 13:59:08 Re: date_part???
Previous Message Tom Lane 2002-08-29 13:56:44 Re: BUG?: timestamp without TZ created as timestamp *with* TZ