From magosoft@gmx.net Tue Sep 9 16:17:15 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2C979D1B4ED for ; Tue, 9 Sep 2003 16:17:15 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 29602-07 for ; Tue, 9 Sep 2003 13:16:43 -0300 (ADT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 7FE10D1B500 for ; Tue, 9 Sep 2003 13:16:42 -0300 (ADT) Received: (qmail 29548 invoked by uid 65534); 9 Sep 2003 16:16:41 -0000 Received: from unknown (EHLO guaj215desa) (168.234.68.22) by mail.gmx.net (mp002) with SMTP; 09 Sep 2003 18:16:41 +0200 MIME-Version: 1.0 Message-Id: <3F5DFCA5.000006.00924@guaj215desa> Date: Tue, 9 Sep 2003 10:15:33 -0600 Content-Type: Multipart/related; type="multipart/alternative"; boundary="------------Boundary-00=_XTFY12S0000000000000" X-Mailer: IncrediMail 2001 (1850912) From: "Marvin" X-FID: FLAVOR00-NONE-0000-0000-000000000000 X-FVER: 3.0 X-CNT: ; X-Priority: 3 To: Subject: Export to file Reply-To: "Marvin" X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=ASCII_FORM_ENTRY, BAYES_30, EXTRA_MPART_TYPE, HTML_60_70, HTML_FONT_FACE_ODD, HTML_TAG_EXISTS_TBODY X-Spam-Level: * X-Archive-Number: 200309/154 X-Sequence-Number: 10242 --------------Boundary-00=_XTFY12S0000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_XTFYWCW0000000000000" --------------Boundary-00=_XTFYWCW0000000000000 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi,=0D There is a way to export the result =0D of a query into an external DBF or TXT table?=0D =0D Thank you,=0D =0D =0D MAGO --------------Boundary-00=_XTFYWCW0000000000000 Content-Type: Text/HTML; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
There is a way to export the result
of a query into an external DBF or TXT table?
 
Thank you,
 
 
MAGO
____________________________= _____________________________________
3D""  IncrediMail - El E-m= ail ha evolucionado finalmente - Haga clic aqu=ED
--------------Boundary-00=_XTFYWCW0000000000000-- --------------Boundary-00=_XTFY12S0000000000000 Content-Type: image/gif; name="IMSTP.gif" Content-Transfer-Encoding: base64 Content-ID: <42B4DAD3-A145-4A25-B419-D8B26BA4531E> R0lGODlhFAAPALMIAP9gAM9gAM8vAM9gL/+QL5AvAGAvAP9gL////wAAAAAA AAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJFAAIACwA AAAAFAAPAAAEVRDJSaudJuudrxlEKI6BURlCUYyjKpgYAKSgOBSCDEuGDKgr AtC3Q/R+hkPJEDgYCjpKr5A8WK9OaPFZwHoPqm3366VKyeRtE30tVVRscMHD qV/u+AgAIfkEBWQACAAsAAAAABQADwAABBIQyUmrvTjrzbv/YCiOZGmeaAQA IfkECRQACAAsAgABABAADQAABEoQIUOrpXIOwrsPxiQUheeRAgUA49YNhbCq K1kS9grQhXGAhsDBUJgZAL2Dcqkk7ogFpvRAokSn0p4PO6UIuUsQggSmFjKX dAgRAQAh+QQFCgAIACwAAAAAFAAPAAAEEhDJSau9OOvNu/9gKI5kaZ5oBAAh +QQJFAAIACwCAAEAEAANAAAEShAhQ6ulcg7Cuw/GJBSF55ECBQDj1g2FsKor WRL2CtCFcYCGwMFQmBkAvYNyqSTuiAWm9ECiRKfSng87pQi5SxCCBKYWMpd0 CBEBACH5BAVkAAgALAAAAAAUAA8AAAQSEMlJq7046827/2AojmRpnmgEADs= --------------Boundary-00=_XTFY12S0000000000000-- From olly@lfix.co.uk Wed Sep 10 09:56:28 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A5191D1B542 for ; Wed, 10 Sep 2003 09:56:28 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 22663-01 for ; Wed, 10 Sep 2003 06:55:59 -0300 (ADT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 0FA89D1B547 for ; Wed, 10 Sep 2003 06:55:56 -0300 (ADT) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 19x1he-00053N-0Z; Wed, 10 Sep 2003 10:55:58 +0100 Received: from [192.168.1.1] (helo=allhosts) by cerberus.lfix.co.uk with esmtp (Exim 4.22) id 19x1hg-0007Te-M7; Wed, 10 Sep 2003 10:56:00 +0100 Subject: Re: Export to file From: Oliver Elphick To: Marvin Cc: pgsql-admin@postgresql.org In-Reply-To: <3F5DFCA5.000006.00924@guaj215desa> References: <3F5DFCA5.000006.00924@guaj215desa> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1063187769.21803.110.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 10 Sep 2003 10:56:09 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/171 X-Sequence-Number: 10259 On Tue, 2003-09-09 at 17:15, Marvin wrote: > Hi, > There is a way to export the result > of a query into an external DBF or TXT table? > You can't write out a DBF file without some other software, but writing a text file is easy. In an interactive session of psql, use: \o filename You probably also want: \pset format unaligned \pset fieldsep ',' \t That would produce a text file with comma-separated values and no headings. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "Draw near to God and he will draw near to you. Cleanse your hands, you sinners; and purify your hearts, you double minded." James 4:8 From bhuvan@symonds.net Wed Sep 10 12:11:27 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 57002D1B538 for ; Wed, 10 Sep 2003 12:11:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 50363-01 for ; Wed, 10 Sep 2003 09:11:09 -0300 (ADT) Received: from Gateway.bksys.co.in (unknown [61.3.64.19]) by svr1.postgresql.org (Postfix) with ESMTP id 9206BD1B53A for ; Wed, 10 Sep 2003 09:11:04 -0300 (ADT) Received: from bksys.co.in (mail.bksys.co.in [192.168.1.1]) by Gateway.bksys.co.in (8.11.6/8.11.6) with ESMTP id h8ACAwK02845; Wed, 10 Sep 2003 17:40:59 +0530 Received: from Bhuvan.bksys.co.in (Bhuvan.bksys.co.in [192.168.1.71]) by bksys.co.in (8.11.6/8.8.5) with ESMTP id h8ACAwB01889; Wed, 10 Sep 2003 17:40:58 +0530 Date: Wed, 10 Sep 2003 17:46:21 +0530 (IST) From: "A.Bhuvaneswaran" X-X-Sender: bhuvan@Bhuvan.bksys.co.in To: Marvin Cc: pgsql-admin@postgresql.org Subject: Re: Export to file In-Reply-To: <3F5DFCA5.000006.00924@guaj215desa> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/173 X-Sequence-Number: 10261 psql=> \o filename.txt psql=> select query; psql=> \o regards, bhuvaneswaran On Tue, 9 Sep 2003, Marvin wrote: > Hi, > There is a way to export the result > of a query into an external DBF or TXT table? > > Thank you, > > > MAGO From rkh@gene.COM Wed Sep 10 16:58:49 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9496CD1B53E for ; Wed, 10 Sep 2003 16:58:49 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 27569-10 for ; Wed, 10 Sep 2003 13:58:17 -0300 (ADT) Received: from djinn.gene.com (djinn-open.gene.com [192.12.78.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1BA94D1BB7C for ; Wed, 10 Sep 2003 12:17:51 -0300 (ADT) Received: from tallac.gene.com (tallac.gene.com [128.137.116.213]) by djinn.gene.com (8.12.9/8.12.9) with ESMTP id h8AFHWDe110257; Wed, 10 Sep 2003 08:17:32 -0700 (PDT) Received: by tallac.gene.com (Postfix, from userid 13922) id F36494B2B3; Wed, 10 Sep 2003 08:17:31 -0700 (PDT) Subject: Re: Export to file From: Reece Hart To: Marvin Cc: "pgsql-admin@postgresql.org" In-Reply-To: <3F5DFCA5.000006.00924@guaj215desa> References: <3F5DFCA5.000006.00924@guaj215desa> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Genentech, Inc. Message-Id: <1063207051.2448.80.camel@tallac> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 10 Sep 2003 08:17:31 -0700 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/174 X-Sequence-Number: 10262 On Tue, 2003-09-09 at 09:15, Marvin wrote: > > There is a way to export the result > of a query into an external DBF or TXT table? > I often do something like this: $ psql -At -c 'select ... where ...' This is so handy, that I have a (bash) shell alias for it: $ alias csbq='psql -UPUBLIC -dcsb -At -c' then $ csbq 'select ...' -Reece -- Reece Hart, Ph.D. rkh@gene.com, http://www.gene.com/ Genentech, Inc. 650/225-6133 (voice), -5389 (fax) Bioinformatics and Protein Engineering 1 DNA Way, MS-93 http://www.in-machina.com/~reece/ South San Francisco, CA 94080-4990 reece@in-machina.com, GPG: 0x25EC91A0