Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 12B8D633810 for ; Wed, 10 Jun 2009 02:50:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 02754-07 for ; Wed, 10 Jun 2009 02:50:38 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mail.postgresql.org (Postfix) with ESMTP id 67704632FBC for ; Wed, 10 Jun 2009 02:50:49 -0300 (ADT) Received: by qw-out-2122.google.com with SMTP id 8so314357qwh.61 for ; Tue, 09 Jun 2009 22:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=Ju0YaBYW85mYE+zhZepsgd8kkabjXC1t/mu+xLNY1Yc=; b=WD5X4nK8ImPEpkxnSjdkvMBREQTv+ex7TlRj9Bhs0gxlrf2rv6zZLBDuZuHCc0J/oV 3i6YAWOvyaUhgggfJ5KqQXxmWj5cIaSnH3CoX6lLoq5bsJ278ss9xkq33dJDkgkLIg8d 8F38DElErRvwlDeUL/3IOZ3Jf1qyUnwxXUvs0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Dv1RO7auvKq7IsxN9ppb90y7xGc/oNSItv7chS8wCYM9MEaTjwVKj99MgX4tQQywwM sutg7Q5ICctsJUY2d/aHglp+Q78i9d5OEVhDfrCRx4rXfQ1+ebXNMjgc2+2zKwB6tqNO RWGVwap0zOvNkaOPsmOKGUnB5AMCUmj+61EKQ= MIME-Version: 1.0 Received: by 10.220.74.65 with SMTP id t1mr876687vcj.89.1244613048343; Tue, 09 Jun 2009 22:50:48 -0700 (PDT) In-Reply-To: <001b01c9e989$821d7610$86586230$@com> References: <003b01c9e8e8$29f09860$7dd1c920$@com> <001b01c9e989$821d7610$86586230$@com> From: Gurjeet Singh Date: Wed, 10 Jun 2009 11:20:28 +0530 Message-ID: <65937bea0906092250g56700350pc869bc43ddffc2bf@mail.gmail.com> Subject: Re: backup To: Jyoti Seth Cc: Jasen Betts , pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=001636285342a11e8d046bf80e11 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200906/42 X-Sequence-Number: 32647 --001636285342a11e8d046bf80e11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit It should be \copy . This is a psql command; if you have direct access to database host machine, you might want to use the SQL command COPY for it's performance. http://www.postgresql.org/docs/8.3/interactive/app-psql.html http://www.postgresql.org/docs/8.3/interactive/sql-copy.html Best regards, On Wed, Jun 10, 2009 at 10:38 AM, Jyoti Seth wrote: > I tried using /copy command. It is not giving any error but also not > creating any file. > > Thanks > Jyoti > > -----Original Message----- > From: pgsql-sql-owner@postgresql.org [mailto: > pgsql-sql-owner@postgresql.org] > On Behalf Of Jasen Betts > Sent: Tuesday, June 09, 2009 6:03 PM > To: pgsql-sql@postgresql.org > Subject: Re: [SQL] backup > > On 2009-06-09, Jyoti Seth wrote: > > This is a multipart message in MIME format. > > > > ------=_NextPart_000_003C_01C9E916.43A8D460 > > Content-Type: text/plain; > > charset="us-ascii" > > Content-Transfer-Encoding: 7bit > > > > Hi all, > > > > > > > > Can we take backup of specific data of a table (using where clause)? > > in psql: > > /copy (select * from table WHERE condition ) to 'FILENAME' > > requires postgres version >= 8.2 IIRC. > > you can use any query. > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- Lets call it Postgres EnterpriseDB http://www.enterprisedb.com gurjeet[.singh]@EnterpriseDB.com singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com Mail sent from my BlackLaptop device --001636285342a11e8d046bf80e11 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
It should be \copy . This is a psql command; if you have d= irect access to database host machine, you might want to use the SQL comman= d COPY for it's performance.

http://www.postgresql.org/docs/8.3/in= teractive/app-psql.html
ht= tp://www.postgresql.org/docs/8.3/interactive/sql-copy.html

Best = regards,

On Wed, Jun 10, 2009 at 10:38 AM= , Jyoti Seth <jyotiseth2001@gmail.com> wrote:
I tried using /co= py command. It is not giving any error but also not
creating any file.

Thanks
Jyoti

-----Original Message-----
From: pgsql-sql-owner@pos= tgresql.org [mailto:p= gsql-sql-owner@postgresql.org]
On Behalf Of Jasen Betts
Sent: Tuesday, June 09, 2009 6:03 PM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] backup

On 2009-06-09, Jyoti Seth <
jy= otiseth2001@gmail.com> wrote:
> This is a multipart message in MIME format.
>
> ------=3D_NextPart_000_003C_01C9E916.43A8D460
> Content-Type: text/plain;
> =A0 =A0 =A0 charset=3D"us-ascii"
> Content-Transfer-Encoding: 7bit
>
> Hi all,
>
>
>
> Can we take backup of specific data of a table (using where clause)?
in psql:

/copy (select * from table WHERE condition ) to 'FILENAME'

requires postgres version >=3D 8.2 IIRC.

you can use any query.

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
= http://www.postgresql.org/mailpref/pgsql-sql


--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
= http://www.postgresql.org/mailpref/pgsql-sql



--
Lets call i= t Postgres

EnterpriseDB =A0 =A0 =A0http://www.enterprisedb.com

gurjeet[.singh]@EnterpriseDB.= com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com
Mail sent fro= m my BlackLaptop device
--001636285342a11e8d046bf80e11--