Re: Why pg_dump doesn't dump the foriegn keys?

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "PostgreSQL-General" <pgsql-general(at)postgresql(dot)org>
Cc: "Raymond Chui" <raymond(dot)chui(at)noaa(dot)gov>
Subject: Re: Why pg_dump doesn't dump the foriegn keys?
Date: 2001-02-06 14:25:06
Message-ID: 006001c09048$9d7046c0$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> pg_dump -u -s dbname > db_schema
>
> I look at that db_schema file, I only see the primary keys but no
> foreign keys.
> I don't understand what is OID use for. Will -o option dump the foreign
> keys for me?

I could be wrong, but it sounds like you haven't examined your entire dump
file. Check the end of the file, after all your COPYs and underneath your
index creations, you *should* see a bunch of "CREATE CONSTRAINT TRIGGER..."
etc. Those should be your foreign key checks, followed by any other triggers
and whatnot. Try importing your dump file into another db and testing it...
you should find that the foreign keys work fine.

Greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brett W. McCoy 2001-02-06 14:26:00 Re: Re: Foreign Keys
Previous Message Adam Lang 2001-02-06 14:21:45 Re: Re: Write to postgreSQL via ODBC?