From sgnerd@yahoo.com.sg Tue Mar 16 09:43:18 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A8E13D1B8CE for ; Tue, 16 Mar 2004 09:43:18 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 84617-03 for ; Tue, 16 Mar 2004 05:43:17 -0400 (AST) Received: from smtp017.mail.yahoo.com (smtp017.mail.yahoo.com [216.136.174.114]) by svr1.postgresql.org (Postfix) with SMTP id 9DF99D1B4C8 for ; Tue, 16 Mar 2004 05:43:14 -0400 (AST) Received: from unknown (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp017.mail.yahoo.com with SMTP; 16 Mar 2004 09:43:13 -0000 Message-ID: <01db01c40b3b$2c897b40$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "psql" Subject: Import from Ms Excel Date: Tue, 16 Mar 2004 15:13:38 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01D6_01C40B69.42324980" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=HTML_50_60, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200403/160 X-Sequence-Number: 17259 This is a multi-part message in MIME format. ------=_NextPart_000_01D6_01C40B69.42324980 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear Friends, Is possible to import data from MS Excel sheet into postgres database 7.3.4= running on Linux 7.2 Thanks Kumar ------=_NextPart_000_01D6_01C40B69.42324980 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Friends,
 
Is possible to import data from MS Excel sheet into pos= tgres=20 database 7.3.4 running on Linux 7.2
 
Thanks
Kumar

------=_NextPart_000_01D6_01C40B69.42324980-- From ajs@crankycanuck.ca Tue Mar 16 11:29:30 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7F001D1E943 for ; Tue, 16 Mar 2004 11:29:30 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 20695-03 for ; Tue, 16 Mar 2004 07:29:31 -0400 (AST) Received: from fep01-mail.bloor.is.net.cable.rogers.com (fep01-mail.bloor.is.net.cable.rogers.com [66.185.86.71]) by svr1.postgresql.org (Postfix) with ESMTP id 27297D1E93F for ; Tue, 16 Mar 2004 07:29:28 -0400 (AST) Received: from phlogiston.dydns.org ([65.49.121.67]) by fep01-mail.bloor.is.net.cable.rogers.com (InterMail vM.5.01.05.12 201-253-122-126-112-20020820) with ESMTP id <20040316112905.XAXP230350.fep01-mail.bloor.is.net.cable.rogers.com@phlogiston.dydns.org> for ; Tue, 16 Mar 2004 06:29:05 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id A378F3DC8; Tue, 16 Mar 2004 06:29:30 -0500 (EST) Date: Tue, 16 Mar 2004 06:29:30 -0500 From: Andrew Sullivan To: psql Subject: Re: Import from Ms Excel Message-ID: <20040316112930.GA4436@phlogiston.dyndns.org> Mail-Followup-To: psql References: <01db01c40b3b$2c897b40$7502a8c0@hdsc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01db01c40b3b$2c897b40$7502a8c0@hdsc.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Authentication-Info: Submitted using SMTP AUTH LOGIN at fep01-mail.bloor.is.net.cable.rogers.com from [65.49.121.67] using ID at Tue, 16 Mar 2004 06:29:05 -0500 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/161 X-Sequence-Number: 17260 On Tue, Mar 16, 2004 at 03:13:38PM +0530, Kumar wrote: > Dear Friends, > > Is possible to import data from MS Excel sheet into postgres > database 7.3.4 running on Linux 7.2 Yes. I find the easiest way is to export a delimited file from Excel and use the \copy command in psql. A -- Andrew Sullivan | ajs@crankycanuck.ca I remember when computers were frustrating because they *did* exactly what you told them to. That actually seems sort of quaint now. --J.D. Baldwin From achill@matrix.gatewaynet.com Tue Mar 16 11:41:50 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C2706D1E929 for ; Tue, 16 Mar 2004 11:41:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 27890-01 for ; Tue, 16 Mar 2004 07:41:51 -0400 (AST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id CF033D1E928 for ; Tue, 16 Mar 2004 07:41:46 -0400 (AST) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id i2GBgkNu001476; Tue, 16 Mar 2004 13:42:46 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id i2GBgkYt001472; Tue, 16 Mar 2004 13:42:46 +0200 Date: Tue, 16 Mar 2004 13:42:45 +0200 (EET) From: Achilleus Mantzios To: Andrew Sullivan Cc: psql Subject: Re: Import from Ms Excel In-Reply-To: <20040316112930.GA4436@phlogiston.dyndns.org> 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: 200403/162 X-Sequence-Number: 17261 O kyrios Andrew Sullivan egrapse stis Mar 16, 2004 : > On Tue, Mar 16, 2004 at 03:13:38PM +0530, Kumar wrote: > > Dear Friends, > > > > Is possible to import data from MS Excel sheet into postgres > > database 7.3.4 running on Linux 7.2 > > Yes. I find the easiest way is to export a delimited file from Excel > and use the \copy command in psql. Another fancy lib (although not necessarilly pgsql specific), is the POI project from jakarta. You can read/write M$ XLS documents from java, and subsequently (via jdbc) manipulate pgsql tables. The good part is that you can dynamically generate an excel file with arbitary content. > > A > > -- -Achilleus From ajs@crankycanuck.ca Tue Mar 16 11:47:16 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9C51DD1E934 for ; Tue, 16 Mar 2004 11:47:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 29878-02 for ; Tue, 16 Mar 2004 07:47:17 -0400 (AST) Received: from fep02-mail.bloor.is.net.cable.rogers.com (fep02-mail.bloor.is.net.cable.rogers.com [66.185.86.72]) by svr1.postgresql.org (Postfix) with ESMTP id 6F39FD1E928 for ; Tue, 16 Mar 2004 07:47:14 -0400 (AST) Received: from phlogiston.dydns.org ([65.49.121.67]) by fep02-mail.bloor.is.net.cable.rogers.com (InterMail vM.5.01.05.12 201-253-122-126-112-20020820) with ESMTP id <20040316114626.VXCP434741.fep02-mail.bloor.is.net.cable.rogers.com@phlogiston.dydns.org> for ; Tue, 16 Mar 2004 06:46:26 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 82C3C3DC8; Tue, 16 Mar 2004 06:47:16 -0500 (EST) Date: Tue, 16 Mar 2004 06:47:16 -0500 From: Andrew Sullivan To: psql Subject: Re: Import from Ms Excel Message-ID: <20040316114716.GA4503@phlogiston.dyndns.org> Mail-Followup-To: psql References: <20040316112930.GA4436@phlogiston.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-Authentication-Info: Submitted using SMTP AUTH LOGIN at fep02-mail.bloor.is.net.cable.rogers.com from [65.49.121.67] using ID at Tue, 16 Mar 2004 06:46:26 -0500 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/163 X-Sequence-Number: 17262 On Tue, Mar 16, 2004 at 01:42:45PM +0200, Achilleus Mantzios wrote: > Another fancy lib (although not necessarilly pgsql specific), > is the POI project from jakarta. > You can read/write M$ XLS documents from java, and > subsequently (via jdbc) manipulate pgsql tables. > > The good part is that you can dynamically generate an excel file > with arbitary content. You can do the same thing (I have done it) with Perl using the Pg and WriteExcel modules. Excel has a lot of pretty annoying limitations, though, and it's fairly dangerous to get too dependent on it for this sort of thing, as you can easily run into its limitations. I suppose it depends on how big your resulting spreadsheets are going to be. In my experience, though, the first thing that happens when you deliver someone a summary spreadsheet is, they ask you for the raw data so they can double-check it. A -- Andrew Sullivan | ajs@crankycanuck.ca This work was visionary and imaginative, and goes to show that visionary and imaginative work need not end up well. --Dennis Ritchie From achill@matrix.gatewaynet.com Tue Mar 16 12:07:24 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id BD6EBD1D549 for ; Tue, 16 Mar 2004 12:07:24 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 28569-06 for ; Tue, 16 Mar 2004 08:07:26 -0400 (AST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id 20844D1B4C8 for ; Tue, 16 Mar 2004 08:07:22 -0400 (AST) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id i2GC8ONu001530; Tue, 16 Mar 2004 14:08:24 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id i2GC8Olh001526; Tue, 16 Mar 2004 14:08:24 +0200 Date: Tue, 16 Mar 2004 14:08:24 +0200 (EET) From: Achilleus Mantzios To: Andrew Sullivan Cc: psql Subject: Re: Import from Ms Excel In-Reply-To: <20040316114716.GA4503@phlogiston.dyndns.org> 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: 200403/164 X-Sequence-Number: 17263 O kyrios Andrew Sullivan egrapse stis Mar 16, 2004 : > On Tue, Mar 16, 2004 at 01:42:45PM +0200, Achilleus Mantzios wrote: > > Another fancy lib (although not necessarilly pgsql specific), > > is the POI project from jakarta. > > You can read/write M$ XLS documents from java, and > > subsequently (via jdbc) manipulate pgsql tables. > > > > The good part is that you can dynamically generate an excel file > > with arbitary content. > > You can do the same thing (I have done it) with Perl using the Pg and > WriteExcel modules. Excel has a lot of pretty annoying limitations, > though, and it's fairly dangerous to get too dependent on it for this > sort of thing, as you can easily run into its limitations. Especially the way "excel" tries to store date/time "cells" (in a way much like cobol in MVS mainframes), or text not being able to contain only numeric chars, etc... > I suppose > it depends on how big your resulting spreadsheets are going to be. > In my experience, though, the first thing that happens when you > deliver someone a summary spreadsheet is, they ask you for the raw > data so they can double-check it. At least they dont have to worry about their latest antivirus update! > > A > > -- -Achilleus From dhudes@tcp-ip.info Tue Mar 16 12:13:53 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 002A4D1D549 for ; Tue, 16 Mar 2004 12:13:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 27667-08 for ; Tue, 16 Mar 2004 08:13:54 -0400 (AST) Received: from screamer.tcp-ip.info (screamer.tcp-ip.info [68.167.18.162]) by svr1.postgresql.org (Postfix) with ESMTP id C8291D1B534 for ; Tue, 16 Mar 2004 08:13:50 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by screamer.tcp-ip.info (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id i2GCDrod015024; Tue, 16 Mar 2004 07:13:53 -0500 Date: Tue, 16 Mar 2004 07:13:53 -0500 (EST) From: Dana Hudes X-X-Sender: dhudes@screamer.tcp-ip.info To: Kumar Cc: psql Subject: Re: Import from Ms Excel In-Reply-To: <01db01c40b3b$2c897b40$7502a8c0@hdsc.com> Message-ID: References: <01db01c40b3b$2c897b40$7502a8c0@hdsc.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/165 X-Sequence-Number: 17264 Certainly you can export your spreadsheet in CSV and it will easily go into Postgresql database (after you create the database and its tables). If you want something more sophisticated, a program in e.g. Perl could use one of the various library programs to extract data in some other-than-straightforward manner (perhaps only certain columns or a certain set of regions?) and then use one of the database libraries (e.g. DBI) to insert into database. The CSV export is the simplest approach. On Tue, 16 Mar 2004, Kumar wrote: > Dear Friends, > > Is possible to import data from MS Excel sheet into postgres database 7.3.4 running on Linux 7.2 > > Thanks > Kumar > From jeff_eckermann@yahoo.com Tue Mar 16 16:14:14 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 470A8D1CAC7 for ; Tue, 16 Mar 2004 16:14:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 31171-05 for ; Tue, 16 Mar 2004 12:14:02 -0400 (AST) Received: from web20812.mail.yahoo.com (web20812.mail.yahoo.com [216.136.226.217]) by svr1.postgresql.org (Postfix) with SMTP id 8EE91D1C969 for ; Tue, 16 Mar 2004 12:14:00 -0400 (AST) Message-ID: <20040316161357.52404.qmail@web20812.mail.yahoo.com> Received: from [24.248.12.72] by web20812.mail.yahoo.com via HTTP; Tue, 16 Mar 2004 08:13:57 PST Date: Tue, 16 Mar 2004 08:13:57 -0800 (PST) From: Jeff Eckermann Subject: Re: Import from Ms Excel To: Andrew Sullivan , psql In-Reply-To: <20040316112930.GA4436@phlogiston.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/177 X-Sequence-Number: 17276 --- Andrew Sullivan wrote: > On Tue, Mar 16, 2004 at 03:13:38PM +0530, Kumar > wrote: > > Dear Friends, > > > > Is possible to import data from MS Excel sheet > into postgres > > database 7.3.4 running on Linux 7.2 > > Yes. I find the easiest way is to export a > delimited file from Excel > and use the \copy command in psql. A couple of quick points: * Don't use .csv, unless you are quite sure that your data does not include any commas. "Copy" isn't smart enough to know that the quotes mean "ignore the delimiters inside here". * If your data does include commas, even using tab-delimited will cause Excel to pointlessly quote those columns, and the quotes will be imported as data unless you remove them. * Make sure to remove any carriage returns that may have been included with your line endings. I think newer versions of "copy" are better about handling that, but best to be sure... > > A > > -- > Andrew Sullivan | ajs@crankycanuck.ca > I remember when computers were frustrating because > they *did* exactly what > you told them to. That actually seems sort of > quaint now. > --J.D. Baldwin > > ---------------------------(end of > broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com From hans@nl.invalid Sun Mar 21 16:54:49 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7E9BAD1E8AB for ; Sun, 21 Mar 2004 16:54:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 92488-01 for ; Sun, 21 Mar 2004 12:54:43 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 0B03FD1D2CE for ; Sun, 21 Mar 2004 12:54:43 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i2LGsg1Y087851 for ; Sun, 21 Mar 2004 16:54:42 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i2LGPkjg083650 for pgsql-sql@postgresql.org; Sun, 21 Mar 2004 16:25:46 GMT Date: Sun, 21 Mar 2004 17:25:31 +0100 From: Hans de Bruin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Import from Ms Excel References: <01db01c40b3b$2c897b40$7502a8c0@hdsc.com> In-Reply-To: <01db01c40b3b$2c897b40$7502a8c0@hdsc.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 16 Message-ID: <405dc1fb$0$574$e4fe514c@news.xs4all.nl> X-Complaints-To: abuse@xs4all.nl To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/250 X-Sequence-Number: 17349 Kumar wrote: > Dear Friends, > > Is possible to import data from MS Excel sheet into postgres database > 7.3.4 running on Linux 7.2 > Install the postgress ODBC drivers. Create a new access database. Create two linked tabels, one to a table in de database and one to the excel sheet. Use a insert into query to transfer the data. -- Hans de Bruin http://eratosthenes.xs4all.nl