Re: How to import a CSV file (originally from Excel) into a Postgresql 8.0.7 database

From: Daniel Tourde <ted(at)foi(dot)se>
To: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to import a CSV file (originally from Excel) into a Postgresql 8.0.7 database
Date: 2006-04-12 12:01:22
Message-ID: 200604121401.22100.ted@foi.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

Thank you for all your answers.
I did indeed generate a .csv from OpenOffice (Excel could do the job as well)
and I imported it into Postgresql using 'copy'.
I had to put the .csv files into /tmp to avoid permissions issues but it went
fine and fast.
To import 45000 lines took about a second. This is impressive...

Thanks for your help.

> > For generation in Excel, you can just use File->Save, and select CSV as
> > the format. You can use either CSV or tab delimited, really.
>
> I am not sure if it matters with postgresql, but other programs require
> (MS-DOS) CSV format rather than the initial CSV choice.
>
> Regards,
>
> Richard

--
**********************************************************************
Daniel TOURDE E-mail : daniel(dot)tourde(at)foi(dot)se
Tel : +46 (0)8-55 50 32 12
Fax : +46 (0)8-55 50 30 68
Cellular : +46 (0)70-849 93 40
FOI, Swedish Defence Research Agency; Systemteknik
Department of Aviation Environmental Research
SE-164 90 Stockholm, Sweden
**********************************************************************

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-04-12 13:57:56 Re: hard shut down of system
Previous Message Devrim GUNDUZ 2006-04-12 11:15:03 Re: [HACKERS] RH9 postgresql 8.0.7 rpm