Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 80A0A9FA0BA for ; Wed, 27 Dec 2006 08:18:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 11463-08 for ; Wed, 27 Dec 2006 08:18:46 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.230]) by postgresql.org (Postfix) with ESMTP id 9097B9FA249 for ; Wed, 27 Dec 2006 08:18:50 -0400 (AST) Received: by nz-out-0506.google.com with SMTP id i11so1791808nzh for ; Wed, 27 Dec 2006 04:18:49 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=gBwZwzC3d6BD4dTatI89GYofKN2mdp0woMpxIUcZc7daS6hVUN//O4vFmiEUZwutRSdgMIlyNBj0rvsCs8l3ZHVmFbtROjS9mhqW2/eyZQfKISBnEZmsLwp1TzUpGHELlwQ2VTuejhLqM7DfRMAdizh9CLrGD8X1Lwh2EQxiztM= Received: by 10.64.193.8 with SMTP id q8mr7164373qbf.1167221929403; Wed, 27 Dec 2006 04:18:49 -0800 (PST) Received: by 10.65.206.17 with HTTP; Wed, 27 Dec 2006 04:18:49 -0800 (PST) Message-ID: Date: Wed, 27 Dec 2006 17:18:49 +0500 From: "Shoaib Mir" To: Enrico Subject: Re: Dump and Query Cc: pgsql-admin@postgresql.org In-Reply-To: <20061227140530.094fc4d3.scotty@linuxtime.it> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_64424_6124278.1167221929366" References: <20061227140530.094fc4d3.scotty@linuxtime.it> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/334 X-Sequence-Number: 24126 ------=_Part_64424_6124278.1167221929366 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline You can use the COPY ( http://www.postgresql.org/docs/current/static/sql-copy.html) command for doing so.... An example will be --> COPY (SELECT * FROM country WHERE country_name LIKE 'A%') TO '/usr1/proj/bray/sql/a_list_countries.copy'; --------------------- Shoaib Mir EnterpriseDB (www.enterprisedb.com) On 12/27/06, Enrico wrote: > > Is there any way to make a dump from a query? > > For example if my query is: > > select field1,field2 from table > > Does it exist a shell command like pg_dump --QUERY myquery -f myfile? > > Have a nice day > Enrico > > -- > If Bill Gates had a penny for everytime Windows crashed,he'd be a > multi-billionaire by now .......oh look, he already is !!!! > scotty@linuxtime.it - Skype:sscotty71 > http://www.linuxtime.it/enricopirozzi > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > ------=_Part_64424_6124278.1167221929366 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline You can use the COPY (http://www.postgresql.org/docs/current/static/sql-copy.html) command for doing so....

An example will be -->

COPY (SELECT * FROM country WHERE country_name LIKE 'A%') TO '/usr1/proj/bray/sql/a_list_countries.copy';

---------------------
Shoaib Mir
EnterpriseDB (www.enterprisedb.com )

On 12/27/06, Enrico <scotty@linuxtime.it> wrote:
Is there any way to make a dump from a query?

For example if my query is:

select field1,field2 from table

Does it exist a shell command like pg_dump --QUERY myquery -f myfile?

Have a nice day
Enrico

--
If Bill Gates had a penny for everytime Windows crashed,he'd be a multi-billionaire by now .......oh look, he already is !!!!
scotty@linuxtime.it - Skype:sscotty71
http://www.linuxtime.it/enricopirozzi

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

------=_Part_64424_6124278.1167221929366--