Re: Import an Excel table to a Postgresql one

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: "Daniele Beauquier" <beauquier(at)univ-paris12(dot)fr>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Import an Excel table to a Postgresql one
Date: 2004-09-17 19:43:44
Message-ID: D425483C2C5C9F49B5B7A41F894415470554AD@postal.corporate.connx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yet another alternative:

Create an ODBC, OLEDB or JDBC connection to PostgreSQL and Excel.
Create a target table in the PostgreSQL table with the attributes that
you desire.
Do an INSERT/SELECT to move the data.

All the data type translations will be done for you by the driver.

If you have thousands of spreadsheet tables, I would suggest using a
specialized tool for the job instead of a manual process to eliminate
errors.

You might want to rename the tables imported by the ODBC driver for MS
Excel, because it will have strange default names like:
country_codes_Excel.dbo.`Sheet1$` which are not exactly enlightening,
unless the spreadsheets already have reasonable names spelled out for
them.

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of
> Daniele Beauquier
> Sent: Friday, September 17, 2004 9:51 AM
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] Import an Excel table to a Postgresql one
>
>
> How to import an Excel table into a Postgresql table in a simple way?

Browse pgsql-general by date

  From Date Subject
Next Message Ioannis Theoharis 2004-09-17 21:42:36 Prefetch children
Previous Message Tom Lane 2004-09-17 19:27:10 Re: converting FK's to "DEFERRABLE"