From: | Philip Warner <pjw(at)rhyme(dot)com(dot)au> |
---|---|
To: | "Paulo Roberto Siqueira" <paulo(dot)siqueira(at)usa(dot)net>, "PGSQL Novice" <pgsql-novice(at)postgresql(dot)org>, "PGSQL Admin" <pgsql-admin(at)postgresql(dot)org>, <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: pg_dump problem |
Date: | 2000-08-04 13:26:07 |
Message-ID: | 3.0.5.32.20000804232607.00bf4330@mail.rhyme.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
At 22:05 3/08/00 -0300, Paulo Roberto Siqueira wrote:
>
>Why doesn't pg_dump give me foreign keys constraints? It happens to all the
>tables with foreign keys.
pg_dump does not restore the database by executing the same set of commands
as you used to create the database. Foreign key constraints are implemented
using a special kind of trigger (CONSTRAINT TRIGGER). If you look through
the pg_dump output, you will find a number of 'CREATE CONSTRAINT TRIGGER'
statements which will reapply the foreign key constraints.
This is definitely not an ideal situation, and with time I hope that
pg_dump output will become as close to ISO SQL as possible. But in the
example you quoted I would expect pg_dump to dump a basic 'create table'
statement followed by several 'alter table add constraint...' statements,
not one complex table definition.
Hope this helps,
Philip Warner.
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/
From | Date | Subject | |
---|---|---|---|
Next Message | Philip Warner | 2000-08-04 14:32:34 | Temporary table error messages different to perm. tables |
Previous Message | Roland Roberts | 2000-08-04 01:36:49 | RH 6.1, PostgreSQL 7.0.2, ipcclean madness |