--- John Harrold <jmh17@pitt.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