Re: [ADMIN] [SQL] Postgres schema comparison.

2005-03-08 Thread Stef
Jim Buttafuoco mentioned : => I use dblink to attach to both databases and query pg_namespace, pg_class, pg_attribute ... to get the diffs. See => attached as an example. look for the dblink_connect lines to specify your database. You will need to install => contrib/dblink. I used this with 7

Re: [ADMIN] [SQL] Postgres schema comparison.

2005-03-07 Thread Jim Buttafuoco
[ADMIN] [SQL] Postgres schema comparison. > Tom Lane mentioned : > => > The problem I have with this, is that I have to run the command per > table, > => > => Why? > => > => If the problem is varying order of table declarations, try 8.0's > => pg_

Re: [ADMIN] [SQL] Postgres schema comparison.

2005-03-07 Thread Stef
Tom Lane mentioned : => > The problem I have with this, is that I have to run the command per table, => => Why? => => If the problem is varying order of table declarations, try 8.0's => pg_dump. Yes, this will solve the global schema check, but I will still need to split it into "per table" dump

Re: [ADMIN] [SQL] Postgres schema comparison.

2005-03-07 Thread Stef
Markus Schaber mentioned : => Some weeks ago, I posted here a script that uses psql to create split => dumps. Maybe you can reuse some of its logics to create per-table => md5sums for all tables in a database automatically. Thanks, but I've got something very similar to this already. I almost tho

Re: [ADMIN] [SQL] Postgres schema comparison.

2005-03-07 Thread Tom Lane
Stef <[EMAIL PROTECTED]> writes: > Markus Schaber mentioned : > => But maybe a pg_dump --schema-only on all the databases, and then > => manually diffing the files may already fulfil your needs. > I've tested something similar, that seems to work ok for me for now : > pg_dump -s -t [TABLE] [DBNAME

Re: [ADMIN] [SQL] Postgres schema comparison.

2005-03-07 Thread Markus Schaber
Hi, Stef, Stef schrieb: > The problem I have with this, is that I have to run the command per table, > and seeing that I have over 500 tables in each database, this takes quite a > long time. Some weeks ago, I posted here a script that uses psql to create split dumps. Maybe you can reuse some o

Re: [ADMIN] [SQL] Postgres schema comparison.

2005-03-07 Thread Stef
Markus Schaber mentioned : => There are (at least) two independently developed pgdiff applications, => they can be found at: => => http://pgdiff.sourceforge.net/ => => http://gborg.postgresql.org/project/pgdiff/projdisplay.php Thanks a lot! => I did not try the first one, but the latter one wor

Re: [SQL] Postgres schema comparison.

2005-03-07 Thread Markus Schaber
Hi, Stef, Stef schrieb: > It will be a bonus to pick up exactly what is missing, but for now, just > identifying > differences is what I want to achieve. I'm using postgres 7.3 mostly, but > I may want to use this for 7.4 and 8.0 databases as well. > > Has anybody got some suggestions of what

[SQL] Postgres schema comparison.

2005-03-07 Thread Stef
Hi all, I've got a master database with many other databases that all have (or is supposed to have) the same exact same schema as the master database (the master database is basically an empty template database containing the schema definition). The problem is that none of the schemas actually