X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 72180DB955 for ; Fri, 18 Nov 2005 09:47:23 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21011-10 for ; Fri, 18 Nov 2005 13:47:26 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id ECE84DB77A for ; Fri, 18 Nov 2005 09:47:20 -0400 (AST) Received: from pjetlic.mobart.hr (pjetlic.mobart.hr [80.80.51.10]) by svr2.postgresql.org (Postfix) with ESMTP id CAAB8F0B2C for ; Fri, 18 Nov 2005 13:47:24 +0000 (GMT) Received: from localhost (localhost.localdomain [127.0.0.1]) by pjetlic.mobart.hr (Postfix) with ESMTP id 33A7817A61 for ; Fri, 18 Nov 2005 14:47:22 +0100 (CET) Received: from pjetlic.mobart.hr ([127.0.0.1]) by localhost (pjetlic [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13828-02-10 for ; Fri, 18 Nov 2005 14:47:22 +0100 (CET) Received: from mike.mobart.hr (mike.mobart.hr [192.168.10.94]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by pjetlic.mobart.hr (Postfix) with ESMTP id 1472F17A19 for ; Fri, 18 Nov 2005 14:47:22 +0100 (CET) Subject: Diffs between two databases... From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: pgsql-admin@postgresql.org Content-Type: text/plain Organization: Mob-Art Date: Fri, 18 Nov 2005 14:47:26 +0100 Message-Id: <1132321646.7965.22.camel@ekim> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by OpenSource AV+AS Mail Server X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/239 X-Sequence-Number: 19612 I have a production server (7.4.9) with, of course, a production database with 30 tables, 250 functions, types, views, indices, ... My developers have created new version of the software, that includes the new version of the datbase. They've changed 6 tables, two dozen views and almost one hundred stored procedures. Now I need to apply those changes on the production server. Is there a way to generate a 'diff' script for the two databases? I'd write script myself if I'd be able to 'script' just the desired object. For instance, just the function. I've seen that I can do pg_dump to a file with pg_dump -Fc, and then I can do pg_restore -Fc -l to have the list of all the database objects. There I can see the functions, but how do I (re)create just the desired function? What would suit me the best would be a tool/util that would drop each db.object into a separate file. Then I could create a script wich will 'load' each object from the file when I want it (so I don't have dependency problems). Is there a tool like that, or should I stick with pg_dump/pg_restore, or maybe even going trough information_schema to see all the objects in the database? Mario -- Mario Splivalo Mob-Art mario.splivalo@mobart.hr "I can do it quick, I can do it cheap, I can do it well. Pick any two."