X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 09D3D9DC862 for ; Sat, 11 Feb 2006 20:10:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14429-05 for ; Sat, 11 Feb 2006 20:10:58 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id CE2DE9DC81A for ; Sat, 11 Feb 2006 20:10:53 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id 3ECB639842; Sun, 12 Feb 2006 00:10:42 +0000 (UTC) Received: (hashcash-sendmail, from uid 1001); Sat, 11 Feb 2006 18:10:41 -0600 Date: Sat, 11 Feb 2006 18:10:41 -0600 From: "Jim C. Nasby" To: Nalin Bakshi Cc: pgsql-admin@postgresql.org Subject: Re: Writing to a flat file using procedures Message-ID: <20060212001041.GV57845@pervasive.com> References: <000801c62eca$8c2452a0$1801a8c0@nalin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000801c62eca$8c2452a0$1801a8c0@nalin> X-Operating-System: FreeBSD 6.0-RELEASE amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060212:nbakshi@bisil.com::2juIDXxF6KgvyQbQ:00000000000000000000 0000000000000000000000000sWU X-Hashcash: 1:20:060212:pgsql-admin@postgresql.org::SlcLQopP6q+w1mLm:00000000000 0000000000000000000000007n+p X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.104 required=5 tests=[AWL=0.104] X-Spam-Score: 0.104 X-Spam-Level: X-Archive-Number: 200602/149 X-Sequence-Number: 20570 On Sat, Feb 11, 2006 at 10:48:08AM +0530, Nalin Bakshi wrote: > Hi! > My project requires me to fetch some data from a a table and write it into a flat file. How can I do this. Could you help? > regards, http://www.postgresql.org/docs/8.1/interactive/sql-copy.html See also \copy on http://www.postgresql.org/docs/8.1/interactive/app-psql.html , which removes the need for the file to be writable by the back-end. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461