Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 8F1179FBB69 for ; Fri, 9 Mar 2007 11:18:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 42980-03 for ; Fri, 9 Mar 2007 11:18:47 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mx1.wp.pl (mx5.wp.pl [212.77.101.9]) by postgresql.org (Postfix) with ESMTP id B11BF9FBB72 for ; Fri, 9 Mar 2007 11:18:53 -0400 (AST) Received: (wp-smtpd smtp.wp.pl 12342 invoked from network); 9 Mar 2007 16:18:51 +0100 Received: from ip-213-17-164-70.netia.com.pl (HELO [127.0.0.1]) (ipluta@[213.17.164.70]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with SMTP for ; 9 Mar 2007 16:18:51 +0100 Message-ID: <45F17AD9.1080507@wp.pl> Date: Fri, 09 Mar 2007 16:18:49 +0100 From: Ireneusz Pluta User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Lukas CC: pgsql-novice@postgresql.org, pgsql-admin@postgresql.org Subject: Re: Pg_dump and bytaA References: <53561.85.206.198.223.1173384127.squirrel@fmf.vtu.lt> In-Reply-To: <53561.85.206.198.223.1173384127.squirrel@fmf.vtu.lt> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.042 tagged_above=0 required=5 tests=AWL, BAYES_40, FORGED_RCVD_HELO, SPF_PASS X-Spam-Level: X-Archive-Number: 200703/40 X-Sequence-Number: 24864 Lukas napisaƂ(a): > Hello, > > we have one table in database (db has over 200 tables), which has one > byteA filed for storing user photos. We are making backup every night, but > it is now too large because of photos. We do not need to make backup of > photos every night, but the question is how to backup database without > this field? > I tried to look at keys of pgdump, but found nothing... > > Now we are using it like this: > pg_dump -f /home/backup/DB.sql -d -Fp -v DB > > thx > Lukas > > A different idea: Why don't you move your photos table to a dedicated schema? Then you can dump only main schema, not including the photos schema, with the -n option to pg_dump. So, assuming that 'public' is the schema where all your other tables exist, your command would look like: pg_dump -n public -f /home/backup/DB.sql -d -Fp -v DB If you then change your mind and find that you need photos dump too, but possibly on a schedule different from the rest, you may be dumping only photos schema with something like: pg_dump -n photos -f /home/backup/photos.sql -d -Fp -v DB however you might want a different output format (compressed?) in this case. Of course, this change would require you to make your application know where the photos table is. But most probably this can be easily done by executing something like "SET search_path TO photos, public", just after each connection to your database. Irek.