Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 72EFE29F0D3 for ; Mon, 12 Mar 2012 11:27:55 -0300 (ADT) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S76E6-0002Xu-LV for pgsql-admin@postgresql.org; Mon, 12 Mar 2012 14:27:55 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 12 Mar 2012 09:27:41 -0500 Message-Id: <4F5DC18902000025000460F1@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Mon, 12 Mar 2012 09:27:37 -0500 From: "Kevin Grittner" To: "Piyush Lenka" , Subject: Re: How to back up selected rows using References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201203/70 X-Sequence-Number: 39258 Piyush Lenka wrote: > How can i backup only 5 records from that table using pg_dump or psql or > both. In psql: \copy ( select * from that_table where ... ) to 'filename' http://www.postgresql.org/docs/9.1/interactive/app-psql.html Search the page for \copy -Kevin