From: | Andrew Gould <andrewgould(at)yahoo(dot)com> |
---|---|
To: | John Harrold <jmh17(at)pitt(dot)edu>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: comparing database schema's |
Date: | 2003-07-22 19:04:29 |
Message-ID: | 20030722190429.67113.qmail@web13405.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
--- John Harrold <jmh17(at)pitt(dot)edu> wrote:
>
> so i have two databases 'A' and 'B'. B is alot like
> A except i've
> added alot of stuff to B like cascade on delete. Now
> 'A' is populated
> with data and i want to add the triggers to it. I
> tried inserting the
> contents of A into the schema of B, but it gave me
> alot of errors
> because it was trying to insert values which have
> primary keys in
> other tables before they had been inserted into the
> tables they are
> referencing. so i decided that i would modify the
> columns of A
> directly, and i was wondering if there was a way to
> compare the schema
> of A to B once i had finished. just to make sure i
> hadnt missed
> anything.
>
> can anyone offer a way to compare db schema? or
> alternatively a better
> way to do what i'm trying to do.
>
> john harrold | \ /
You can dump the schemas into separate files for
comparison. Assuming tables A and B are both in
database C:
pg_dump -s -t A C > schema_a
pg_dump -s -t B C > schema_b
I hope this helps,
Andrew
From | Date | Subject | |
---|---|---|---|
Next Message | scott.marlowe | 2003-07-22 19:24:26 | Re: New Poll @ Codewalkers |
Previous Message | Ken Schenke | 2003-07-22 19:01:40 | String Comparison / Embedded Spaces |