Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5AF34632DEA for ; Fri, 16 Jul 2010 12:48:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 80141-04 for ; Fri, 16 Jul 2010 15:48:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 459A2632EDD for ; Fri, 16 Jul 2010 12:48:17 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Fri, 16 Jul 2010 10:48:16 -0500 Message-Id: <4C4038EC0200002500033719@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Fri, 16 Jul 2010 10:48:12 -0500 From: "Kevin Grittner" To: , Subject: Re: conditional backup References: <4C4038AC0200002500033716@gw.wicourts.gov> <4C4038EC0200002500033719@gw.wicourts.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/109 X-Sequence-Number: 35128 suhailck wrote: > I need to take backup of my postgresql DB, but not all records > from a few tables. You can exclude particular tables from a database backup using the -T option (which can be included multiple times). You can dump just the schema for particular tables with the -s and -t switches. You can use the \copy command in psql to copy out selected rows using syntax like: \copy (select * from C_order where period=2009 and org <> 'A') to C_order.data You should be able to wire something together from those pieces. -Kevin