Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 9F0BA1337BBA for ; Wed, 30 Mar 2011 18:37:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 12125-08 for ; Wed, 30 Mar 2011 21:36:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id 153C21337B83 for ; Wed, 30 Mar 2011 18:36:57 -0300 (ADT) Received: from [127.0.0.1] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id p2ULaoc04569 for ; Wed, 30 Mar 2011 14:36:50 -0700 Message-ID: <4D93A272.9000101@hogranch.com> Date: Wed, 30 Mar 2011 14:36:50 -0700 From: John R Pierce User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: pg_restore References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/1043 X-Sequence-Number: 174304 On 03/30/11 1:56 PM, Mike Orr wrote: > MySQL simply locks the tables, drops/recreates them, loads the data, > and unlocks the tables. Other connections have to wait but they don't > have to be closed/reopened. The PostgreSQL manual recommends restoring > into an empty database using template0, which would require first > closing the other connections and then dropping the database. It would > also take unnecessary time to recreate the database and tables that > aren't changing. So I'm wondering if there's a less obtrusive way to > refresh the data. its a backup server, right? so noone is accessing it, are they? rather than using pg_dump -Fc |pg_restore, you can use pg_dump | psql ... and you can tell pg_dump in this mode to only dump specified tables. however, you might look at PITR and/or WAL log shipping rather than dump/restore. this would only update new data, and when you playback the WAL log on the backup server bring it up to whatever point in time you want.